[GH-ISSUE #503] API认证时UDP通信时导致程序异常退出 #405

Open
opened 2026-02-27 23:16:47 +03:00 by kerem · 0 comments
Owner

Originally created by @agenge on GitHub (Oct 10, 2022).
Original GitHub issue: https://github.com/snail007/goproxy/issues/503

Expected Behavior

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

Current Behavior

UDP程序通信时,使用API认证(--auth-url)无法通过认证,goproxy程序直接崩溃退出。

Possible Solution

Steps to Reproduce

1.启动命令:
proxy sps -t tcp -p "111.111.111.111:1880" --udp --disable-ss --disable-http --auth-url http://127.0.0.1/auth.php --debug
2. auth.php,参照的文档中的示例:

image

  1. 使用sockscap64 测试UDP,使用标准的SK5协议
  2. goproxy直接退出
    image

Context (Environment)

  1. proxy version is : commercial_12.2
  2. full command is :
    proxy sps -t tcp -p "111.111.111.111:1880" --udp --disable-ss --disable-http --auth-url http://127.0.0.1/auth.php --debug
  3. system is : Ubuntu 20.04.4 LTS 、Kernel: Linux ubuntu 5.4.0-125
  4. full log is(部分信息已脱敏):
    `2022/10/10 20:28:27.718319 lic-checker/checker.go:788 INFO check success, your machine will expired at 2023-0x-xx 10:00:00
    2022/10/10 20:28:32 Unsolicited response received on idle HTTP channel starting with "user1===> user1"; err=
    2022/10/10 20:28:32.599942 sps/sps.go:854 INFO user user1, ip sk5_client_ip, upstream socks5://username:pass@sk5_server_ip:port, [0.0.0.0]
    2022/10/10 20:28:32.600095 sps/socksudp_hs.go:74 INFO s5 udp on sk5_server_ip:30496
    2022/10/10 20:28:32 Unsolicited response received on idle HTTP channel starting with "user1===> user1"; err=
    panic: runtime error: invalid memory address or nil pointer dereference
    [signal SIGSEGV: segmentation violation code=0x1 addr=0x40 pc=0xaf56e5]

goroutine 158 [running]:
github.com/snail007/proxy/utils/lb.(*Group).Select2(0x0, 0xc00054a9c0, 0x15, 0xc0007cc600, 0x0, 0x0, 0x0)
/Users/user/go/src/github.com/snail007/proxy/utils/lb/lb.go:89 +0x65
github.com/snail007/proxy/utils/lb.(*Group).Select(...)
/Users/user/go/src/github.com/snail007/proxy/utils/lb/lb.go:84
github.com/snail007/proxy/services/sps.(*SPS).shadow.func1(0xc00027de30, 0x3, 0xc000792ff0)
/Users/user/go/src/github.com/snail007/proxy/services/sps/util.go:101 +0x313
github.com/snail007/proxy/utils/udp.(*UDPRelay).Start.func1(0xc000382140, 0xc000176f80)
/Users/user/go/src/github.com/snail007/proxy/utils/udp/udp.go:166 +0x705
created by github.com/snail007/proxy/utils/udp.(*UDPRelay).Start
/Users/user/go/src/github.com/snail007/proxy/utils/udp/udp.go:122 +0x167
`

Detailed Description

Possible Implementation

Originally created by @agenge on GitHub (Oct 10, 2022). Original GitHub issue: https://github.com/snail007/goproxy/issues/503 <!--- Provide a general summary of the issue in the Title above --> ## Expected Behavior 使用API认证(--auth-url)时,UDP能通过认证,且成功代理。 ## Current Behavior UDP程序通信时,使用API认证(--auth-url)无法通过认证,goproxy程序直接崩溃退出。 ## Possible Solution <!--- Not obligatory, but suggest a fix/reason for the bug, --> ## Steps to Reproduce <!--- Provide a link to a live example, or an unambiguous set of steps to --> <!--- reproduce this bug. Include code to reproduce, if relevant --> 1.启动命令: proxy sps -t tcp -p "111.111.111.111:1880" --udp --disable-ss --disable-http --auth-url http://127.0.0.1/auth.php --debug 2. auth.php,参照的文档中的示例: 在 <img width="566" alt="image" src="https://user-images.githubusercontent.com/3004334/194866260-f5e1aa67-7201-45fa-9a5d-20bfc66898ee.png"> 3. 使用sockscap64 测试UDP,使用标准的SK5协议 4. goproxy直接退出 <img width="914" alt="image" src="https://user-images.githubusercontent.com/3004334/194866762-3a63c045-f738-4856-807d-300b9ebdd210.png"> ## Context (Environment) <!--- How has this issue affected you? What are you trying to accomplish? --> <!--- Providing context helps us come up with a solution that is most useful in the real world --> 1. proxy version is : commercial_12.2 2. full command is : `proxy sps -t tcp -p "111.111.111.111:1880" --udp --disable-ss --disable-http --auth-url http://127.0.0.1/auth.php --debug` 3. system is : Ubuntu 20.04.4 LTS 、Kernel: Linux ubuntu 5.4.0-125 4. full log is(部分信息已脱敏): `2022/10/10 20:28:27.718319 lic-checker/checker.go:788 INFO check success, your machine will expired at 2023-0x-xx 10:00:00 2022/10/10 20:28:32 Unsolicited response received on idle HTTP channel starting with "user1===> user1"; err=<nil> 2022/10/10 20:28:32.599942 sps/sps.go:854 INFO user user1, ip sk5_client_ip, upstream socks5://username:pass@sk5_server_ip:port, [0.0.0.0] 2022/10/10 20:28:32.600095 sps/socksudp_hs.go:74 INFO s5 udp on sk5_server_ip:30496 2022/10/10 20:28:32 Unsolicited response received on idle HTTP channel starting with "user1===> user1"; err=<nil> panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x40 pc=0xaf56e5] goroutine 158 [running]: github.com/snail007/proxy/utils/lb.(*Group).Select2(0x0, 0xc00054a9c0, 0x15, 0xc0007cc600, 0x0, 0x0, 0x0) /Users/user/go/src/github.com/snail007/proxy/utils/lb/lb.go:89 +0x65 github.com/snail007/proxy/utils/lb.(*Group).Select(...) /Users/user/go/src/github.com/snail007/proxy/utils/lb/lb.go:84 github.com/snail007/proxy/services/sps.(*SPS).shadow.func1(0xc00027de30, 0x3, 0xc000792ff0) /Users/user/go/src/github.com/snail007/proxy/services/sps/util.go:101 +0x313 github.com/snail007/proxy/utils/udp.(*UDPRelay).Start.func1(0xc000382140, 0xc000176f80) /Users/user/go/src/github.com/snail007/proxy/utils/udp/udp.go:166 +0x705 created by github.com/snail007/proxy/utils/udp.(*UDPRelay).Start /Users/user/go/src/github.com/snail007/proxy/utils/udp/udp.go:122 +0x167 ` <!--- Provide a general summary of the issue in the Title above --> ## Detailed Description <!--- Provide a detailed description of the change or addition you are proposing --> ## Possible Implementation <!--- Not obligatory, but suggest an idea for implementing addition or change -->
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/goproxy#405
No description provided.