goproxy icon indicating copy to clipboard operation
goproxy copied to clipboard

关于 API认证时UDP通信时的问题

Open agenge opened this issue 1 year ago • 0 comments

Expected Behavior

使用API认证(--auth-url)时,UDP能通过认证,且成功代理。

Current Behavior

UDP程序通信时,使用API认证(--auth-url)无法通过认证

Possible Solution

Steps to Reproduce

  1. 启动命令: proxy sps -t tcp -p ":1880" --udp-port 1880 --udp --disable-ss --disable-http --auth-url http://127.0.0.1/auth.php

2.Python写了个 UDP Server/Client(参考示例:点这里),使用命令行认证模式,UDP测试正常。 但使用 --auth-url 认证模式,提示认证失败,报以下错误:

utils/structs.go:501 WARN auth fail from url http://127.0.0.1/auth.php?user=&pass=&client_addr=1.1.1.1:28761&local_addr=[::]:1880&target=&service=socks&sps=1,resonse code: 200, except: 204 , 1.1.1.1:28761 -> [::]:1880 可以看出 user pass都为空导致。 3. 通过tcpdump抓包,发现有2次 http请求(实际上测试工具只请了一次),但是抓包的结果来看,第一次请求有带认证信息,第二次请求无认证信息(user pass为空)

tcpdump -A -i lo tcp port 1880

Context (Environment)

  1. proxy version is : commercial_12.1
  2. full command is : proxy sps -t tcp -p ":1880" --udp-port 1880 --udp --disable-ss --disable-http --auth-url http://127.0.0.1/auth.php
  3. system is : Ubuntu 20.04.4 LTS 、Kernel: Linux ubuntu 5.4.0-125
  4. full log is: ?

Detailed Description

Possible Implementation

agenge avatar Sep 13 '22 05:09 agenge