go-gost / gost

GO Simple Tunnel - a simple tunnel written in golang
https://gost.run
MIT License
4.39k stars 528 forks source link

error: tcp over udp is unsupported #438

Closed LittleHans8 closed 6 months ago

LittleHans8 commented 8 months ago

I My local server doesn't support udp protocol, but it supports tcp protocol.

So I want to convert tcp to udp on the server side and then convert tcp to udp on the client side, but it seems this is not supported, does gost support this kind of forwarding?

I checked the documentation and it seems that it is possible to forward udp traffic as http or sock5 traffic, but I want to make sure that tcp and udp ports are supported.

This is the command I am running on the server.(convert tcp to udp on the server side)

./gost -L tcp://127.0.0.1:8212 -F udp://127.0.0.1:8211

This is the command I'm running on the client.(convert tcp to udp on the client side, the tcp traffic has been successfully forwarded by other tools and is running on port 9300)

./gost -L udp://127.0.0.1:9400 -F tcp://127.0.0.1:9300

This is the error I'm getting.

{"address":":0","connector":"http","dialer":"udp","hop":"hop-0","kind":"connector","level":"error","local":"127.0.0.1:35728","msg":"tcp over udp is unsupported","network":"tcp","node":"node-0","remote":"127.0.0.1:8211","time":"2024-03-29T12:40:05.581Z"}
ginuerzh commented 8 months ago

Theoretically you should not forward TCP data over plain-UDP protocol directly, it may not work as you expect. Instead you can use the reliable UDP-based protocol such as QUIC, KCP.