erebe / wstunnel

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

Address family not supported by protocol (os error 97) #177

Closed yu-james closed 6 months ago

yu-james commented 6 months ago

Describe the bug Tried to deploy the server to a CloudFoundry environment, in order to forward WireGuard traffic, and got this error: Rejecting connection with bad upgrade request: Address family not supported by protocol (os error 97) /morille/events?bearer=eyJ0eXA...

Client shows this: Doing TLS handshake using sni DnsName("server hostname") with the server "server hostnam":443 2023-10-31T04:17:54.919499Z ERROR tunnel{id="018b83f3-caef-7933-89c7-57a5b5da66c5" remote="10.11.0.1:1801"}: wstunnel::tunnel::client: failed to do websocket handshake with the server (Domain("server hostname"), 443)

It does work if deployed to a local Docker. And it used to work with version 6 and before.

To Reproduce Steps to reproduce the behavior: Server command in CloudFoundry: RUST_LOG=trace ./wstunnel server ws://0.0.0.0:8080

Client command local: wstunnel client -L udp://0.0.0.0:51820:10.11.0.1:1801 wss://"server hostname"

erebe commented 6 months ago

By any chances, do your host on cloudfoundry does only have an IPv4 address and not support ipv6 even locally ?

erebe commented 6 months ago

Can you try the new release https://github.com/erebe/wstunnel/releases/tag/v7.8.2 and let me know ?

yu-james commented 6 months ago

Yes it is working! Amazing!

P.S. Hope you enjoy the coffees ;-)

yu-james commented 6 months ago

By any chances, do your host on cloudfoundry does only have an IPv4 address and not support ipv6 even locally ?

Looks like the case. That was a CloudFoundry Docker deployment and Docker seems to disable ipv6 by default in many cases.

https://docs.docker.com/config/daemon/ipv6/

erebe commented 6 months ago

haha thanks for letting me know :)< It was the only possible explanation :+1: