erebe / wstunnel

Tunnel all your traffic over Websocket or HTTP2 - Bypass firewalls/DPI - Static binary available
Other
3.22k stars 290 forks source link

I have some problem in wstunnel and wireguard。 #182

Closed jsdfhasuh closed 6 months ago

jsdfhasuh commented 6 months ago

Server Error message:

2023-11-07T13:52:37.050639Z INFO wstunnel::tunnel::server: Accepting connection 2023-11-07T13:52:37.058061Z ERROR tunnel{peer="120.235.42.234:16204"}: wstunnel::tunnel::server: Error while upgrading cnx to websocket: hyper::Error(Parse(Method)) 2023-11-07T13:52:40.283385Z INFO wstunnel::tunnel::server: Accepting connection 2023-11-07T13:52:40.287580Z ERROR tunnel{peer="120.235.42.234:16364"}: wstunnel::tunnel::server: Error while upgrading cnx to websocket: hyper::Error(Parse(Method)) 2023-11-07T13:52:40.326826Z INFO wstunnel::tunnel::server: Accepting connection 2023-11-07T13:52:40.336858Z ERROR tunnel{peer="120.235.42.234:16308"}: wstunnel::tunnel::server: Error while upgrading cnx to websocket: hyper::Error(Parse(Method)) 2023-11-07T13:52:40.778829Z INFO wstunnel::tunnel::server: Accepting connection 2023-11-07T13:52:40.787118Z ERROR tunnel{peer="120.235.42.234:16364"}: wstunnel::tunnel::server: Error while upgrading cnx to websocket: hyper::Error(Parse(Method)) 2023-11-07T13:52:41.626254Z INFO wstunnel::tunnel::server: Accepting connection 2023-11-07T13:52:41.636115Z ERROR tunnel{peer="120.235.42.234:16308"}: wstunnel::tunnel::server: Error while upgrading cnx to websocket: hyper::Error(Parse(Method)) 2023-11-07T13:52:43.274059Z INFO wstunnel::tunnel::server: Accepting connection 2023-11-07T13:52:43.284217Z ERROR tunnel{peer="120.235.42.234:16362"}: wstunnel::tunnel::server: Error while upgrading cnx to websocket: hyper::Error(Parse(Method)) 2023-11-07T13:52:49.692049Z INFO wstunnel::tunnel::server: Accepting connection 2023-11-07T13:52:49.695059Z ERROR tunnel{peer="120.235.42.234:16222"}: wstunnel::tunnel::server: Error while upgrading cnx to websocket: hyper::Error(Parse(Method)) 2023-11-07T13:52:49.895621Z INFO wstunnel::tunnel::server: Accepting connection 2023-11-07T13:52:49.899783Z ERROR tunnel{peer="120.235.42.234:16196"}: wstunnel::tunnel::server: Error while upgrading cnx to websocket: hyper::Error(Parse(Method)) 2023-11-07T13:52:58.461102Z INFO wstunnel::tunnel::server: Accepting connection 2023-11-07T13:52:58.465751Z ERROR tunnel{peer="120.235.42.234:16220"}: wstunnel::tunnel::server: Error while upgrading cnx to websocket: hyper::Error(Parse(Method)) 2023-11-07T13:53:05.218554Z INFO wstunnel::tunnel::server: Accepting connection 2023-11-07T13:53:05.222417Z ERROR tunnel{peer="120.235.42.234:16204"}: wstunnel::tunnel::server: Error while upgrading cnx to websocket: hyper::Error(Parse(Method)) 2023-11-07T13:53:06.265111Z INFO wstunnel::tunnel::server: Accepting connection 2023-11-07T13:53:06.271077Z ERROR tunnel{peer="120.235.42.234:16352"}: wstunnel::tunnel::server: Error while upgrading cnx to websocket: hyper::Error(Parse(Method)) 2023-11-07T13:53:06.704450Z INFO wstunnel::tunnel::server: Accepting connection 2023-11-07T13:53:06.708489Z ERROR tunnel{peer="120.235.42.234:16320"}: wstunnel::tunnel::server: Error while upgrading cnx to websocket: hyper::Error(Parse(Method)) 2023-11-07T13:53:07.547241Z INFO wstunnel::tunnel::server: Accepting connection 2023-11-07T13:53:07.551104Z ERROR tunnel{peer="120.235.42.234:16352"}: wstunnel::tunnel::server: Error while upgrading cnx to websocket: hyper::Error(Parse(Method)) 2023-11-07T13:53:09.960214Z INFO wstunnel::tunnel::server: Accepting connection 2023-11-07T13:53:09.964626Z ERROR tunnel{peer="120.235.42.234:16324"}: wstunnel::tunnel::server: Error while upgrading cnx to websocket: hyper::Error(Parse(Method)) 2023-11-07T13:53:11.307708Z INFO wstunnel::tunnel::server: Accepting connection 2023-11-07T13:53:11.308141Z ERROR tunnel{peer="120.235.42.234:16270"}: wstunnel::tunnel::server: Error while upgrading cnx to websocket: hyper::Error(Parse(Method)) 2023-11-07T13:53:12.639157Z INFO wstunnel::tunnel::server: Accepting connection 2023-11-07T13:53:12.643115Z ERROR tunnel{peer="120.235.42.234:16310"}: wstunnel::tunnel::server: Error while upgrading cnx to websocket: hyper::Error(Parse(Method)) 2023-11-07T13:53:13.077909Z INFO wstunnel::tunnel::server: Accepting connection 2023-11-07T13:53:13.081848Z ERROR tunnel{peer="120.235.42.234:16175"}: wstunnel::tunnel::server: Error while upgrading cnx to websocket: hyper::Error(Parse(Method)) 2023-11-07T13:53:13.925798Z INFO wstunnel::tunnel::server: Accepting connection 2023-11-07T13:53:13.929608Z ERROR tunnel{peer="120.235.42.234:16259"}: wstunnel::tunnel::server: Error while upgrading cnx to websocket: hyper::Error(Parse(Method))

Client Error message:

Caused by: received corrupt message of type InvalidContentType) 2023-11-07T13:53:05.235815Z INFO wstunnel::udp: New UDP connection from 127.0.0.1:23456 2023-11-07T13:53:05.235927Z INFO wstunnel::tcp: Opening TCP connection to 113.xxx.xxx.xxx:23457
2023-11-07T13:53:06.257104Z INFO wstunnel::tls: Doing TLS handshake using sni IpAddress(113.xxx.xxx.xxx) with the server 113.xxx.xxx.xxx:23457 2023-11-07T13:53:06.682100Z INFO wstunnel::tcp: Opening TCP connection to 113.xxx.xxx.xxx:23457
2023-11-07T13:53:06.698308Z INFO wstunnel::tls: Doing TLS handshake using sni IpAddress(113.xxx.xxx.xxx) with the server 113.xxx.xxx.xxx:23457 2023-11-07T13:53:07.520762Z INFO wstunnel::tcp: Opening TCP connection to 113.xxx.xxx.xxx:23457
2023-11-07T13:53:07.538342Z INFO wstunnel::tls: Doing TLS handshake using sni IpAddress(113.xxx.xxx.xxx) with the server 113.xxx.xxx.xxx:23457 2023-11-07T13:53:09.936915Z INFO wstunnel::tcp: Opening TCP connection to 113.xxx.xxx.xxx:23457
2023-11-07T13:53:09.954256Z INFO wstunnel::tls: Doing TLS handshake using sni IpAddress(113.xxx.xxx.xxx) with the server 113.xxx.xxx.xxx:23457 2023-11-07T13:53:11.278246Z INFO wstunnel::tcp: Opening TCP connection to 113.xxx.xxx.xxx:23457
2023-11-07T13:53:11.296016Z INFO wstunnel::tls: Doing TLS handshake using sni IpAddress(113.xxx.xxx.xxx) with the server 113.xxx.xxx.xxx:23457 2023-11-07T13:53:11.601043Z ERROR tunnel{id="018baa0e-e6d3-7e0f-b4a6-1c0d4073e2d5" remote="localhost:23456"}: wstunnel::tunnel::client: failed to get a connection to the server from the pool: User(failed to do TLS handshake with the server (Ipv4(113.xxx.xxx.xxx), 23457)

Caused by: received corrupt message of type InvalidContentType) 2023-11-07T13:53:11.601149Z INFO wstunnel::udp: New UDP connection from 127.0.0.1:23456 2023-11-07T13:53:11.601284Z INFO wstunnel::tcp: Opening TCP connection to 113.xxx.xxx.xxx:23457
2023-11-07T13:53:12.632560Z INFO wstunnel::tls: Doing TLS handshake using sni IpAddress(113.xxx.xxx.xxx) with the server 113.xxx.xxx.xxx:23457 2023-11-07T13:53:13.058415Z INFO wstunnel::tcp: Opening TCP connection to 113.xxx.xxx.xxx:23457
2023-11-07T13:53:13.072414Z INFO wstunnel::tls: Doing TLS handshake using sni IpAddress(113.xxx.xxx.xxx) with the server 113.xxx.xxx.xxx:23457 2023-11-07T13:53:13.180504Z INFO wstunnel::tcp: Opening TCP connection to 113.xxx.xxx.xxx:23457
2023-11-07T13:53:13.898615Z INFO wstunnel::tcp: Opening TCP connection to 113.xxx.xxx.xxx:23457
2023-11-07T13:53:13.917697Z INFO wstunnel::tls: Doing TLS handshake using sni IpAddress(113.xxx.xxx.xxx) with the server 113.xxx.xxx.xxx:23457 2023-11-07T13:53:15.252665Z INFO wstunnel::tls: Doing TLS handshake using sni IpAddress(113.xxx.xxx.xxx) with the server 113.xxx.xxx.xxx:23457 2023-11-07T13:53:15.824381Z INFO wstunnel::tcp: Opening TCP connection to 113.xxx.xxx.xxx:23457
2023-11-07T13:53:15.844510Z INFO wstunnel::tls: Doing TLS handshake using sni IpAddress(113.xxx.xxx.xxx) with the server 113.xxx.xxx.xxx:23457 2023-11-07T13:53:19.068389Z INFO wstunnel::tcp: Opening TCP connection to 113.xxx.xxx.xxx:23457
2023-11-07T13:53:19.085543Z INFO wstunnel::tls: Doing TLS handshake using sni IpAddress(113.xxx.xxx.xxx) with the server 113.xxx.xxx.xxx:23457 2023-11-07T13:53:21.675461Z INFO wstunnel::tcp: Opening TCP connection to 113.xxx.xxx.xxx:23457
2023-11-07T13:53:21.693115Z INFO wstunnel::tls: Doing TLS handshake using sni IpAddress(113.xxx.xxx.xxx) with the server 113.xxx.xxx.xxx:23457 2023-11-07T13:53:25.584261Z INFO wstunnel::tcp: Opening TCP connection to 113.xxx.xxx.xxx:23457
2023-11-07T13:53:25.603074Z INFO wstunnel::113.xxx.xxx.xxx:23457 2023-11-07T13:53:21.675461Z INFO wstunnel::tcp: Opening TCP connection to 113.xxx.xxx.xxx:23457
2023-11-07T13:53:21.693115Z INFO wstunnel::tls: Doing TLS handshake using sni IpAddress(113.xxx.xxx.xxx) with the server 113.xxx.xxx.xxx:23457 2023-11-07T13:53:25.584261Z INFO wstunnel::tcp: Opening TCP connection to 113.xxx.xxx.xxx:23457
2023-11-07T13:53:25.603074Z INFO wstunnel::tls: Doing TLS handshake using sni IpAddress(113.xxx.xxx.xxx) with the server 113.xxx.xxx.xxx:23457

my Client command:

wstunnel client -L udp://127.0.0.1:51820:localhost:23456?timeout_sec=0 --http-upgrade-path-prefix wstunnel wss://113.xxx.xxx.xxx:23457

my Server command:

./wstunnel server --restrict-to 127.0.0.1:23456 --websocket-ping-frequency-sec 30 --restrict-http-upgrade-path-prefix wstunnel ws://0.0.0.0:23457

my Server wireguard conf:

config wireguard_WireGuard option route_allowed_ips '1' option endpoint_port '23456' option public_key 'XXX' option preshared_key 'XXX' option persistent_keepalive '25' list allowed_ips '192.168.100.0/24' list allowed_ips '192.168.100.1/32' list allowed_ips '192.168.97.0/24'

my Client wireguard conf

config wireguard_WireGuard option public_key 'xxx' option preshared_key 'xxx' option route_allowed_ips '1' option persistent_keepalive '25' list allowed_ips '192.168.1.0/24' list allowed_ips '192.168.99.0/24' list allowed_ips '125.88.70.0/24' list allowed_ips '125.88.104.0/24' list allowed_ips '183.59.230.0/23' list allowed_ips '183.59.232.0/21' list allowed_ips '183.59.240.0/24' list allowed_ips '192.168.97.0/24' option endpoint_host '127.0.0.1' option endpoint_port '51820'

jsdfhasuh commented 6 months ago

my wstunnel version is 7.9.1 server is x86 openwrt client is AArch64 Processor : Cortex-A53 2 & Cortex-A73 4 openwrt

yu-james commented 6 months ago

Client and server should be same protocol, either ws or wss

jsdfhasuh commented 6 months ago

Client and server should be same protocol, either ws or wss

thank you