PurpleI2P / i2pd

🛡 I2P: End-to-End encrypted and anonymous Internet
https://i2pd.website
BSD 3-Clause "New" or "Revised" License
3.14k stars 419 forks source link

SOCKS proxy didn't fetch response from upstream SOCKS proxy #1683

Open r4sas opened 2 years ago

r4sas commented 2 years ago
07:16:20@683/debug - I2PService: SOCKS accepted
07:16:20@683/debug - SOCKS: async sock read
07:16:20@683/debug - SOCKS: received 3 bytes
07:16:20@683/debug - SOCKS: v5 choosing authentication method: 0
07:16:20@683/debug - SOCKS: async sock read
07:16:20@683/debug - SOCKS: received 17 bytes
07:16:20@683/info - SOCKS: requested github.com:443
07:16:20@683/info - SOCKS: forwarding to upstream
07:16:20@683/info - SOCKS: upstream proxy resolved
07:16:20@683/info - SOCKS: connected to upstream proxy
07:16:20@683/info - SOCKS: negotiating with upstream proxy
07:16:20@683/debug - SOCKS: async upstream sock read
07:16:29@683/error - SOCKS: upstream proxy failure: 84
07:16:29@683/warn - SOCKS: v5 request failed: 1
07:16:29@683/debug - SOCKS: closing socket
07:16:29@683/debug - SOCKS: closing upstream socket
r4sas commented 2 years ago

Problem in current upstream request code, which is negotiate only with SOCKS4 proxy: https://github.com/PurpleI2P/i2pd/blob/ba369d9b3064eaf01a4b9bf523fa680928e7cafa/libi2pd_client/SOCKS.cpp#L277-L283

Need to rewrite that part.

Nokia808 commented 1 year ago

Hi. I can not use outproxy inspite the fact that I enabled it since long time & it was working okay. Is this related to this issue or not? Do I have need to open an independent issue about "Failure of outproxy setting" or not?

r4sas commented 1 year ago

Hi. I can not use outproxy inspite the fact that I enabled it since long time & it was working okay. Is this related to this issue or not? Do I have need to open an independent issue about "Failure of outproxy setting" or not?

Provide logs.

wekoq commented 1 year ago

similar problem: when try connect with quassel core:

[04/Jan/2023:23:06:00 +0300]@654/info - SOCKS: Requested <domain>
[04/Jan/2023:23:06:00 +0300]@654/info - SOCKS: Forwarding to upstream
[04/Jan/2023:23:06:00 +0300]@654/info - SOCKS: Upstream proxy resolved
[04/Jan/2023:23:06:00 +0300]@654/warn - SOCKS: Could not connect to upstream proxy: Connection refused

as R4SAS say, problem here (usage of incorrect port): 645 line in ClientContext.cpp auto tun = std::make_shared<i2p::proxy::SOCKSProxy>(name, address, port, !outproxy.empty(), outproxy, destinationPort, localDestination);

and another problem, with curl: curl -x socks4://127.0.0.1:4449 http://...

[04/Jan/2023:23:14:51 +0300]@654/error - SOCKS: Request with v4a rejected because it's actually SOCKS4
[04/Jan/2023:23:14:51 +0300]@654/warn - SOCKS: v4 request failed: 8

curl -x socks5://127.0.0.1:4449 http://...

[05/Jan/2023:00:31:30 +0300]@654/error - SOCKS: v5 unsupported address type: 1
[05/Jan/2023:00:31:30 +0300]@654/warn - SOCKS: v5 request failed: 8
nahuhh commented 1 year ago

@majestrate @r4sas any plans to fix? Has been a couple years.

thanks