apernet / hysteria

Hysteria is a powerful, lightning fast and censorship resistant proxy.
https://v2.hysteria.network/
MIT License
14.68k stars 1.64k forks source link

在Hysteria 服务器里面同时启动一个Http Server 请问如何访问这个 Http Server #1116

Open theothersideofgod opened 3 months ago

theothersideofgod commented 3 months ago

Describe the bug 在hysteria 机器里面 同时启动一个 http 服务器 比如port: 8058

可是尝试访问这个myhysterialMachine.ddns.net:8086 网址的时候 没有反应

尝试在 acl 里面 direct 这个 这个port 跟网址 好像没效果

(使用的是 V1)

To Reproduce Steps to reproduce the behavior.

Expected behavior A clear and concise description of what you expected to happen.

Logs Attach logs from the client/server when the error occurs.

Device and Operating System What are you using it on.

Additional context Add any other context about the problem here.

haruue commented 3 months ago

你在运行 hysteria 服务器的 VPS 上执行下面这样的命令直接访问这个网站, 能正常访问吗?

curl myhysterialMachine.ddns.net:8086
theothersideofgod commented 3 months ago

你在运行 hysteria 服务器的 VPS 上执行下面这样的命令直接访问这个网站, 能正常访问吗?

curl myhysterialMachine.ddns.net:8086

vps curl myhysterialMachine.ddns.net:8086 --> 不行 vps curl localhost:8086 --> 行

如果不开启 hysteria 客户端 我可以访问

haruue commented 3 months ago

vps curl myhysterialMachine.ddns.net:8086 --> 不行

这种其实是你服务器自身的网络配置问题, hysteria 服务端访问网站, 其实和你在 VPS 上 curl 这个网站, 基本上是一样的。

考虑到你例子里用的是 ddns.net, 你是不是用的家宽 NAT 小鸡, 这个地址并不是直接在你 VPS 的某个接口上, 而是由上游路由器转发给你的 VPS 的。

theothersideofgod commented 3 months ago

对 我是用 家里的电脑 当服务器 然后 用 免费的 ddns 供应商 生成的 网址 去指向 ip

然后家宽 再 port forwarding 指定的 port

image

那这样的话 要从那一段修正? 还是说使用方式 有错误?

这个 服务器 现在 透过 myhysterialMachine.ddns.net:8086 直接访问 是没问题的

但是 如果我把 hysteria 客户端打开 他就访问不到了

所以我想能不能 用 acl 让 hysterial 客户端 不要代理这个 myhysterialMachine.ddns.net:8086

acl 如下

direct domain myhysterialMachine.ddns.net */8086

还是 我 acl 格式 不对