heiher / hev-socks5-server

A high-performance socks5 server for Unix (Linux/Android/BSD/macOS)
MIT License
185 stars 33 forks source link

[功能请求] UDP ASSOCIATE支持内网部署外网访问 #45

Closed mayongze closed 2 months ago

mayongze commented 2 months ago

现在当客户端发起udp associate请求时, 返回给客户的是一个固定的本地网卡地址, 这里返回的地址是否可以自定义设置, 并且所有客户端复用同一个udp端口

我的使用场景:

  1. 在内网中运行hev-socks5-server
  2. 通过路由器映射端口
  3. 在外部环境发起udp请求的时候期望返回的是路由的IP地址
heiher commented 2 months ago

目前UDP Associate的服务器端绑定地址是从当前TCP连接获取的相同的服务器侧地址,端口是随机分配的。可以增加两个配置项用于指定UDP的绑定地址和端口用于覆盖默认行为。对于你的场景,只有一路地址转换的情况下,应该只需指定为固定端口即可。

heiher commented 2 months ago

https://github.com/heiher/hev-socks5-server/releases/tag/2.6.4-next