erebe / wstunnel

Tunnel all your traffic over Websocket or HTTP2 - Bypass firewalls/DPI - Static binary available
BSD 3-Clause "New" or "Revised" License
4.34k stars 372 forks source link

Error while upgrading cnx: hyper::Error(HeaderTimeout) #361

Closed nxtreaming closed 1 month ago

nxtreaming commented 1 month ago

Describe the bug

Error while upgrading cnx: hyper::Error(HeaderTimeout)

To Reproduce

the server side:

./wstunnel server wss://0.0.0.0:8080

The client side: ./wstunnel client -L socks5://127.0.0.1:8888 --connection-min-idle 5 wss://test.myserver.com:8080

test by curl: curl -v -x socks5h://127.0.0.1:8888 https://www.google.com/

curl output:

Expected behavior

working

Your wstunnel setup

Paste your logs of wstunnel, started with --log-lvl=DEBUG, and with the command line used

2024-09-28T06:24:44.323791Z INFO wstunnel::protocols::tcp::server: Opening TCP connection to test.myserver.com:8080

2024-09-28T06:24:44.323875Z INFO wstunnel::protocols::tcp::server: Opening TCP connection to test.myserver.com:8080

2024-09-28T06:24:44.323927Z INFO wstunnel::protocols::tcp::server: Opening TCP connection to test.myserver.com:8080

2024-09-28T06:24:44.324009Z INFO wstunnel::protocols::tcp::server: Opening TCP connection to test.myserver.com:8080

2024-09-28T06:24:44.511408Z INFO wstunnel::protocols::tls::server: Doing TLS handshake using SNI DnsName("test.myserver.com") with the server test.myserver.com:8080 2024-09-28T06:24:44.511693Z INFO wstunnel::protocols::tls::server: Doing TLS handshake using SNI DnsName("test.myserver.com") with the server test.myserver.com:8080 2024-09-28T06:24:44.511774Z INFO wstunnel::protocols::tls::server: Doing TLS handshake using SNI DnsName("test.myserver.com") with the server test.myserver.com:8080 2024-09-28T06:24:44.511875Z INFO wstunnel::protocols::tls::server: Doing TLS handshake using SNI DnsName("test.myserver.com") with the server test.myserver.com:8080 2024-09-28T06:24:44.514524Z INFO wstunnel::protocols::tls::server: Doing TLS handshake using SNI DnsName("test.myserver.com") with the server test.myserver.com:8080 2024-09-28T06:24:44.525597Z INFO wstunnel::protocols::socks5::tcp_server: Starting SOCKS5 server listening cnx on 127.0.0.1:8888 with credentials None 2024-09-28T06:25:44.325163Z INFO wstunnel::protocols::tcp::server: Opening TCP connection to test.myserver.com:8080

2024-09-28T06:25:44.325263Z INFO wstunnel::protocols::tcp::server: Opening TCP connection to test.myserver.com:8080

2024-09-28T06:25:44.325319Z INFO wstunnel::protocols::tcp::server: Opening TCP connection to test.myserver.com:8080

2024-09-28T06:25:44.325396Z INFO wstunnel::protocols::tcp::server: Opening TCP connection to test.myserver.com:8080

2024-09-28T06:25:44.325451Z INFO wstunnel::protocols::tcp::server: Opening TCP connection to test.myserver.com:8080

2024-09-28T06:25:44.507196Z INFO wstunnel::protocols::tls::server: Doing TLS handshake using SNI DnsName("test.myserver.com") with the server test.myserver.com:8080 2024-09-28T06:25:44.507499Z INFO wstunnel::protocols::tls::server: Doing TLS handshake using SNI DnsName("test.myserver.com") with the server test.myserver.com:8080 2024-09-28T06:25:44.510472Z INFO wstunnel::protocols::tls::server: Doing TLS handshake using SNI DnsName("test.myserver.com") with the server test.myserver.com:8080 2024-09-28T06:25:44.510602Z INFO wstunnel::protocols::tls::server: Doing TLS handshake using SNI DnsName("test.myserver.com") with the server test.myserver.com:8080 2024-09-28T06:25:44.510688Z INFO wstunnel::protocols::tls::server: Doing TLS handshake using SNI DnsName("test.myserver.com") with the server test.myserver.com:8080 2024-09-28T06:26:44.324734Z INFO wstunnel::protocols::tcp::server: Opening TCP connection to test.myserver.com:8080

2024-09-28T06:26:44.324823Z INFO wstunnel::protocols::tcp::server: Opening TCP connection to test.myserver.com:8080

2024-09-28T06:26:44.324919Z INFO wstunnel::protocols::tcp::server: Opening TCP connection to test.myserver.com:8080

2024-09-28T06:26:44.325019Z INFO wstunnel::protocols::tcp::server: Opening TCP connection to test.myserver.com:8080

2024-09-28T06:26:44.325076Z INFO wstunnel::protocols::tcp::server: Opening TCP connection to test.myserver.com:8080

2024-09-28T06:26:44.463253Z INFO wstunnel::protocols::tls::server: Doing TLS handshake using SNI DnsName("test.myserver.com") with the server test.myserver.com:8080 2024-09-28T06:26:44.463379Z INFO wstunnel::protocols::tls::server: Doing TLS handshake using SNI DnsName("test.myserver.com") with the server test.myserver.com:8080 2024-09-28T06:26:44.463463Z INFO wstunnel::protocols::tls::server: Doing TLS handshake using SNI DnsName("test.myserver.com") with the server test.myserver.com:8080 2024-09-28T06:26:44.466137Z INFO wstunnel::protocols::tls::server: Doing TLS handshake using SNI DnsName("test.myserver.com") with the server test.myserver.com:8080 2024-09-28T06:26:44.466357Z INFO wstunnel::protocols::tls::server: Doing TLS handshake using SNI DnsName("test.myserver.com") with the server test.myserver.com:8080 2024-09-28T06:27:11.921241Z ERROR tunnel{id="0192374f-d5b0-7483-911b-8e3e05faf97f" remote="google.com:80"}: wstunnel::tunnel::client::client: failed to do websocket handshake with the server wss://test.myserver.com:8080

Caused by: 0: operation was canceled 1: connection error 2: peer closed connection without sending TLS close_notify: https://docs.rs/rustls/latest/rustls/manual/_03_howto/index.html#unexpected-eof 2024-09-28T06:27:11.923370Z INFO wstunnel::protocols::tcp::server: Opening TCP connection to test.myserver.com:8080

2024-09-28T06:27:11.935121Z INFO wstunnel::protocols::tls::server: Doing TLS handshake using SNI DnsName("test.myserver.com") with the server test.myserver.com:8080 2024-09-28T06:27:21.210279Z ERROR tunnel{id="0192374f-f9fa-7941-9636-c46c7c38a3d2" remote="google.com:80"}: wstunnel::tunnel::client::client: failed to do websocket handshake with the server wss://test.myserver.com:8080

Caused by: 0: operation was canceled 1: connection error 2: peer closed connection without sending TLS close_notify: https://docs.rs/rustls/latest/rustls/manual/_03_howto/index.html#unexpected-eof 2024-09-28T06:27:21.210341Z INFO wstunnel::protocols::tcp::server: Opening TCP connection to test.myserver.com:8080

2024-09-28T06:27:21.221897Z INFO wstunnel::protocols::tls::server: Doing TLS handshake using SNI DnsName("test.myserver.com") with the server test.myserver.com:8080 2024-09-28T06:27:44.325640Z INFO wstunnel::protocols::tcp::server: Opening TCP connection to test.myserver.com:8080

2024-09-28T06:27:44.325801Z INFO wstunnel::protocols::tcp::server: Opening TCP connection to test.myserver.com:8080

2024-09-28T06:27:44.325886Z INFO wstunnel::protocols::tcp::server: Opening TCP connection to test.myserver.com:8080

2024-09-28T06:27:44.325928Z INFO wstunnel::protocols::tcp::server: Opening TCP connection to test.myserver.com:8080

2024-09-28T06:27:44.334074Z INFO wstunnel::protocols::tls::server: Doing TLS handshake using SNI DnsName("test.myserver.com") with the server test.myserver.com:8080 2024-09-28T06:27:44.334292Z INFO wstunnel::protocols::tls::server: Doing TLS handshake using SNI DnsName("test.myserver.com") with the server test.myserver.com:8080 2024-09-28T06:27:44.334392Z INFO wstunnel::protocols::tls::server: Doing TLS handshake using SNI DnsName("test.myserver.com") with the server test.myserver.com:8080 2024-09-28T06:27:44.337387Z INFO wstunnel::protocols::tls::server: Doing TLS handshake using SNI DnsName("test.myserver.com") with the server test.myserver.com:8080 2024-09-28T06:27:48.539727Z INFO wstunnel::protocols::tcp::server: Opening TCP connection to test.myserver.com:8080

2024-09-28T06:27:48.540096Z ERROR tunnel{id="01923750-64bb-7800-9d5d-61f24c26a43f" remote="www.google.com:443"}: wstunnel::tunnel::client::client: failed to do websocket handshake with the server wss://test.myserver.com:8080

Caused by: 0: operation was canceled 1: connection error 2: peer closed connection without sending TLS close_notify: https://docs.rs/rustls/latest/rustls/manual/_03_howto/index.html#unexpected-eof

Note: 1.2.3.4 is the IP of test.myserver.com

Desktop (please complete the following information):

Additional context Nothing.

erebe commented 1 month ago

it is a duplicate of this one https://github.com/erebe/wstunnel/issues/358

Would you mind trying the pre-release specified and let me know if it solve your issue

erebe commented 1 month ago

Made a proper release https://github.com/erebe/wstunnel/releases/tag/v10.1.2

Let me know if it is ok.

nxtreaming commented 1 month ago

It works

Thanks.