klzgrad/naiveproxy

naiveproxy can't bind to local link inet6 address

smaller09 opened this issue · 5 comments

`naive --listen=socks://[fe80::1]:1000 --proxy=https://user:password@server.com

[0213/224437.512125:ERROR:socket_posix.cc(147)] bind() failed: Invalid argument (22)

[0213/224437.512356:ERROR:naive_proxy_bin.cc(679)] Failed to listen on socks://fe80::1 1000: ERR_INVALID_ARGUMENT
`

5l2 commented

Cannot be replicated. Are you sure the address you want to listen to exists on the interface?

br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1492 qdisc noqueue state UP qlen 1000
link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
inet 192.168.1.1/24 brd 192.168.1.255 scope global br-lan
valid_lft forever preferred_lft forever
inet6 2409:xxxx:xxxx:xxxx::1/64 scope global dynamic noprefixroute
valid_lft 258699sec preferred_lft 172299sec
inet6 fe80::xxxx:xxxx:xxxx:63ce/64 scope link
valid_lft forever preferred_lft forever

tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 8500 qdisc mq state UNKNOWN qlen 500
link/[65534]
inet 198.168.1.254/32 scope global tun0
valid_lft forever preferred_lft forever
inet6 fe80::3c15:6189:68f8:d85c/64 scope link flags 800
valid_lft forever preferred_lft forever
inet6 fe80::1/128 scope link
valid_lft forever preferred_lft forever

naive --listen=socks://[fe80::xxxx:xxxx:xxxx:63ce]:1000 --proxy=https://user:password@server.com
[0214/010023.200002:ERROR:socket_posix.cc(147)] bind() failed: Invalid argument (22)
[0214/010023.200248:ERROR:naive_proxy_bin.cc(679)] Failed to listen on socks://fe80::xxxx:xxxx:xxxx:63ce 1000: ERR_INVALID_ARGUMENT

naive --listen=socks://fe80::xxxx:xxxx:xxxx:63ce:1000 --proxy=https://user:password@server.com
[0214/010320.044574:ERROR:socket_posix.cc(147)] bind() failed: Invalid argument (22)
[0214/010320.044799:ERROR:naive_proxy_bin.cc(679)] Failed to listen on socks://fe80::xxxx:xxxx:xxxx:63ce 1000: ERR_INVALID_ARGUMENT

naive 120.0.6099.43

PS: I had found naive can listen to global inet6 address.

naive --listen=socks://2409:xxxx:xxxx:xxxx::1:1000 --proxy=https://user:password@server.com
this worrks.

5l2 commented

Why would you want to bind the link-local address only? To use the LLA, you also need to specify the scope of the interface associated with the address.

because my naiveproxy client is located on router. and I don't want it can be accessed over the internet for the safety reson.

To use the LLA, you also need to specify the scope of the interface associated with the address.

how can I do this?

I googled around , link local address should not bind. so assign a ula address sovle this problem.