apernet / hysteria

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

hysteria2 cannot establish a connection #704

Closed Catcher-u closed 11 months ago

Catcher-u commented 11 months ago

I'm using an Oracle vps. After installation hysteria2 works fine, but it does not connect successfully either through a third party client or the official one. Someone please help me with this, thanks.

Catcher-u commented 11 months ago

Server config: `listen: :443

acme: domains:

masquerade: type: proxy proxy: url: https://bing.com rewriteHost: true`

Client config: ` server: someone.net:443

auth: passwd

bandwidth: up: 20 mbps down: 100 mbps

socks5: listen: 127.0.0.1:1080

http: listen: 127.0.0.1:8080 `

Catcher-u commented 11 months ago

The server side is working fine. ` ubuntu@instance:~$ sudo systemctl status hysteria-server.service ● hysteria-server.service - Hysteria Server Service (config.yaml) Loaded: loaded (/etc/systemd/system/hysteria-server.service; enabled; vendor preset: enabled) Active: active (running) since Sun 2023-09-17 10:04:16 UTC; 1 day 22h ago Main PID: 518765 (hysteria) Tasks: 5 (limit: 1110) Memory: 14.6M CPU: 2.154s CGroup: /system.slice/hysteria-server.service └─518765 /usr/local/bin/hysteria server --config /etc/hysteria/config.yaml

Sep 17 10:04:16 instance systemd[1]: Started Hysteria Server Service (config.yaml). Sep 17 10:04:16 instance hysteria[518765]: 2023-09-17T10:04:16Z INFO server mode Sep 17 10:04:16 instance hysteria[518765]: 2023-09-17T10:04:16Z INFO maintenance started background certifi> Sep 17 10:04:16 instance hysteria[518765]: 2023-09-17T10:04:16Z INFO server up and running Client can't connect [I] ~/D/P/hysteria2 ❯❯❯ ./hysteria-darwin-amd64-avx 2023-09-20T11:18:32+08:00 INFO client mode 2023-09-20T11:18:37+08:00 FATAL failed to initialize client {"error": "connect error: timeout: no recent network activity"} `

tobyxdd commented 11 months ago

https://v2.hysteria.network/docs/advanced/Troubleshooting/#failed-to-initialize-client-connect-error-timeout-no-recent-network-activity

catcheru commented 11 months ago

Thanks for your answer. I've checked the article listing possible problems, but it didn't solved.

  1. The server is not running Server is running, confirmed with systemctl.
  2. The port is blocked by a firewall
       ubuntu@instance:~$ sudo lsof -i:443
       COMMAND     PID     USER   FD   TYPE  DEVICE SIZE/OFF NODE NAME
       hysteria 555625 hysteria    3u  IPv6 8928487      0t0  UDP *:https
  3. The server is running at a different address or port. After confirming that the domain and port are correct.
  4. The server is listening on a network that's inaccessible to the client. The server can be reached, but the packet loss rate is relatively high.
  5. The domain name is not resolving to the correct IP address. Domain resolves correctly.
  6. Incorrect obfuscation settings The config file is given above.
tobyxdd commented 11 months ago

I've never used Oracle but don't they have firewall settings on the console? Have you opened the port there

LiXianYua commented 11 months ago

I also have the same problem

tobyxdd commented 11 months ago

Test if your UDP port is reachable with nc first. https://help.ubidots.com/en/articles/937233-sending-tcp-udp-packets-using-netcat#udp-client

Catcher-u commented 11 months ago

This error is due to the default security list of the VPS not having udp rules open. Thank you for your patience.