go-gost / gost

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

私有隧道无法转发UDP流量 #569

Closed SianHH closed 2 months ago

SianHH commented 2 months ago

最新20240904版本,问题任然存在。

本地测试环境:

本地用于测试端口转发的服务

gost.exe -L file://:8080

本地的UDP服务

gost.exe -L relay+quic://:33667

Tunnel服务端配置

services:
- name: service-0
  addr: :8443
  handler:
    type: tunnel
    metadata:
      ingress: ingress-0
  listener:
    type: ws
ingresses:
- name: ingress-0
  rules:
  - hostname: "srv-2.local"
    endpoint: $ac74d9dd-3125-442a-a7c1-f9e49e05faca

Tunnel客户端

gost.exe -L rudp://:0/127.0.0.1:33667 -F tunnel+ws://:8443?tunnel.id=ac74d9dd-3125-442a-a7c1-f9e49e05faca

Tunnel访问端

gost.exe -L udp://127.0.0.1:16666/srv-2.local -F tunnel+ws://127.0.0.1:8443?tunnel.id=ac74d9dd-3125-442a-a7c1-f9e49e05faca

测试使用本地端口转发

将quic协议修改ws/wss等tcp为底层协议,将rudp和udp修改为rtcp和tcp,就可以正常转发服务,经测试,Tunnel私有隧道无法转发UDP流量

ginuerzh commented 2 months ago

客户端要开启连接保活: https://gost.run/tutorials/port-forwarding/#udp

gost.exe -L udp://127.0.0.1:16666/srv-2.local?keepalive=true -F tunnel+ws://127.0.0.1:8443?tunnel.id=ac74d9dd-3125-442a-a7c1-f9e49e05faca
SianHH commented 2 months ago

感谢解答,问题已经解决