go-gost / gost

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

UDP over TCP 转发的实现问题。 #531

Closed leeaash closed 3 months ago

leeaash commented 4 months ago

我尝试了一种远端服务器socks5+tls,本地端口转发的代理实现,结构如下: socks-client — gost-client — traefik — gost-server-internet 其中traefik和server都在vps的容器上实现,tls在traefik passthrough给gost容器 两端配置如下: Gost-server: -L=socks5+tls://:58964?bind=true&notls=true&udp=true&keepAlive=true&ttl=30s Gost-clinet: -L=tcp://:10368 -F=forward+tls://example.com:443?interface=pppoe-wan Clash配置socks代理为本机10368端口 目前问题现配置只能跑通tcp,无法跑通udp,但感觉配上应该能实现啊。

ginuerzh commented 4 months ago

SOCKS5的UDP-over-TCP是GOST特有功能,第三方客户端大概率是不支持的。

leeaash commented 4 months ago

但怎么解释我再套层socks5其实是可以的。 Gost-server: -L=socks5+tls://:58964?bind=true&notls=true&udp=true&keepAlive=true&ttl=30s Gost-clinet: -L=socks5://:10368?udp=true&bind=true&keepAlive=true&ttl=30s -F=socks5+tls://example.com:443?interface=pppoe-wan

我的另一种实现 Gost-server: -L=relay+tls://:58964?bind=true&nodelay=true Gost-clinet: -L=socks5://:10368?udp=true&bind=true&keepAlive=true&ttl=30s -F=relay+tls://example.com:443?interface=pppoe-wan&nodelay=true

感觉把socks放前端就好了,不明其久

ginuerzh commented 4 months ago

GOST SOCKS5客户端默认使用UDP-over-TCP传输UDP数据。

leeaash commented 4 months ago

是socks服务一定要在client端才应用udp-over-tcp的意思?

ginuerzh commented 4 months ago

是的。