nneonneo / iOS-SOCKS-Server

iOS HTTP/SOCKS proxy server for fake-tethering
268 stars 33 forks source link

Issues with git/ssh #17

Closed marijnbent closed 1 year ago

marijnbent commented 1 year ago

Hi there!

First off all, all the love for creating the script. Has been a lifesaver.

Unfortunately, I cannot fetch repos from Github, or SSH into a external server.

ssh forge@165.xxx.xx.xxx
kex_exchange_identification: read: Operation timed out
banner exchange: Connection to 165.xxx.xx.xxx port 22: Operation timed out
gh repo sync
Post "https://api.github.com/graphql": net/http: TLS handshake timeout
git fetch origin -v
fatal: unable to access 'https://github.com/xxx': error:02FFF03C:system library:func(4095):Operation timed out

Any idea what the issue could be? Nothing specifically interesting is logged in the sock5.py log.

nneonneo commented 1 year ago

I put the following in ~/.ssh/config (with my proxy at 172.16.20.1):

Host github.com
    ProxyCommand nc -X 5 -x 172.16.20.1:9876 %h %p

and then git clone git@github.com:nneonneo/iOS-SOCKS-Server.git runs properly over the proxy, as does ssh git@github.com. As noted in the README, you can also put the ProxyCommand directly in your ssh command, e.g. ssh -o ProxyCommand='nc -X 5 -x 172.16.20.1:9876 %h %p' git@github.com.

gh and git should understand the https_proxy environment variable. For example, these work for me:

$ https_proxy=socks5://172.16.20.1:9876 gh repo list nneonneo
$ https_proxy=socks5://172.16.20.1:9876 git clone https://github.com/nneonneo/iOS-SOCKS-Server