mirror of
https://github.com/snail007/goproxy.git
synced 2026-04-27 16:35:49 +03:00
[GH-ISSUE #503] API认证时UDP通信时导致程序异常退出 #405
Labels
No labels
TODO
bug
duplicate
enhancement
good first issue
help wanted
helpful
invalid
need-confirm
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/goproxy#405
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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,参照的文档中的示例:
在
Context (Environment)
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`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