rofl0r / microsocks

tiny, portable SOCKS5 server with very moderate resource usage
Other
1.48k stars 266 forks source link

Connect to server running on the same machine #51

Closed DUOLabs333 closed 2 years ago

DUOLabs333 commented 2 years ago

I have a Macbook, and I want to run microsocks on it. However, when I added it in Network settings, I can see in the logs that it's connecting, but using curl -x socks5h://localhost:1080 google.com gives me Empty Reply, and Chrome fails to load the page.

rofl0r commented 2 years ago

can you try the latest release ? it may have been broken inadvertently by the last commits. also an strace of the server process would be interesting. (on mac, there's dtruss).

DUOLabs333 commented 2 years ago

Still doesn't work. The trace is from the last release:

<removed useless huge paste>
DUOLabs333 commented 2 years ago

This does happen with SSH and shadowsocks, so it might be a limitation in the SOCKS protocol.

rofl0r commented 2 years ago

the thing you pasted doesnt actually give me a trace. rather, it appears to be the tracing script.

DUOLabs333 commented 2 years ago

Oh, I had to disable SIP first. It doesn't crash though, so how long do I hold the trace?

rofl0r commented 2 years ago

it should be sufficient to have one failed transaction in the trace.

DUOLabs333 commented 2 years ago

Here's a stack with it failing: https://pastebin.com/CR5LtX8Z

rofl0r commented 2 years ago

it takes until about line 1000 to see the first connect(), therefore it appears the previous connections dont even reach line 187. maybe sprinkle a couple debug printfs into that function to see what it does and how far it gets.

DUOLabs333 commented 2 years ago

I do want to say that no connections go through, though.

rofl0r commented 2 years ago

what are you doing, anyway? you mentioned shadowsocks and ssh. please provide more details.

DUOLabs333 commented 2 years ago

I just want to connect to a SOCKS proxy that is running on the same machine. SSH and shadowsocks are two ways to run SOCKS proxy.

DUOLabs333 commented 2 years ago

Interestingly enough, if I run it on another IP address (like the one provided by Wireguard), it now gives "SOCKS_CONNECTION_FAILED".

rofl0r commented 2 years ago

change line 57 to 128*1024 and recompile

DUOLabs333 commented 2 years ago

Line 57 in which file?

On Wed, Jan 5, 2022, 11:07 AM rofl0r @.***> wrote:

change line 57 to 128*1024 and recompile

— Reply to this email directly, view it on GitHub https://github.com/rofl0r/microsocks/issues/51#issuecomment-1005859331, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALXWUYAC6YILHSBPNA5M7FLUURUCPANCNFSM5LIBBSWA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

rofl0r commented 2 years ago

in THE file, sockssrv.c

DUOLabs333 commented 2 years ago

Still says "Connection Closed".

DUOLabs333 commented 2 years ago

I got it to work -- apparently, it is a problem with MacOS's Proxy configuration. Using FoxyProxy solved this problem.