git cl upload via SOCKS proxy?

359 views
Skip to first unread message

Dan Beam

unread,
Apr 18, 2015, 12:24:53 AM4/18/15
to Chromium-dev, Marc-Antoine Ruel
Hey all,

Is there a way I can upload patches through a SOCKS proxy from the command line?  Currently using a hacky^Wtethered internet connection.

I've tried all kinds of fun stuff, e.g. setting these environment variables:

  http_proxy, https_proxy, HTTP_PROXY, HTTPS_PROXY, SOCKS_SERVER

with all kinds of fun values:

  socks5://127.0.0.1:8080, http://127.0.0.1:8080, s/127.0.0.1/localhost/

and have also tried hacking up depot_tools/git_cl.py with 2 version of socksipy[1] which generally results in:

  urllib2.URLError: <urlopen error unknown url type: socks5>

Any ideas?

-- Dan

[1] https://code.google.com/p/socksipy-branch/

Robert Flack

unread,
Apr 18, 2015, 3:13:31 AM4/18/15
to db...@chromium.org, Chromium-dev, Marc-Antoine Ruel

tsocks should work in a pinch. Running "tsocks git cl upload" should force all connections to be made through the proxy of your choice specified by the config file ~/.tsocks.conf


--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev

Dan Beam

unread,
Apr 19, 2015, 4:00:02 PM4/19/15
to Robert Flack, Chromium-dev, Marc-Antoine Ruel
On Sat, Apr 18, 2015 at 3:12 AM, Robert Flack <fla...@chromium.org> wrote:

tsocks should work in a pinch. Running "tsocks git cl upload" should force all connections to be made through the proxy of your choice specified by the config file ~/.tsocks.conf

Ultimately I haven't been able to get tsocks nor proxychains working for my particular case.  Neither tsocks nor proxychains built cleanly on Mac, and after I fixing their code they still had issues (i.e. didn't work).  I'm not sure their approach of listening for shared library connect() calls are sufficiently robust (maybe something's statically linked or using a different libc?).

Additionally, git hasn't been working for me either (even though it's got built-in proxy capabilities):

  $ git config --global http.proxy socks5://127.0.0.1:8080
  $ git config --global https.proxy socks5://127.0.0.1:8080
  $ GIT_CURL_VERBOSE=1 git clone https://github.com/git/git.git
  Cloning into 'git'...
  * Couldn't find host github.com in the .netrc file; using defaults
  * About to connect() to proxy 127.0.0.1 port 8080 (#0)  // <-- looks correct
  *   Trying 127.0.0.1...
  * Adding handle: conn: 0x7fa63a004400
  * Adding handle: send: 0
  * Adding handle: recv: 0
  * Curl_addHandleToPipeline: length: 1
  * - Conn 0 (0x7fa63a004400) send_pipe: 1, recv_pipe: 0
  * Could not resolve host: github.com  // <-- oh noes!
  * Closing connection 0
  fatal: unable to access 'https://github.com/git/git.git/': Could not resolve host: github.com

DNS doesn't seem to be resolved using the proxy.

Still looking for workarounds.

-- Dan

Robert Flack

unread,
Apr 20, 2015, 9:54:02 AM4/20/15
to Dan Beam, Chromium-dev, Marc-Antoine Ruel
Looks like the easy way to get tsocks on mac is through homebrew - if you want to give that a try: https://whatbox.ca/wiki/tsocks. tsocks also doesn't forward DNS through the SOCKS proxy by default. This can only be enabled at compile time, and probably requires that your SOCKS proxy supports UDP. Your mileage may vary though I've only personally used tsocks on linux from the package manager to forward TCP connections.

Marc-Antoine Ruel

unread,
Apr 20, 2015, 4:35:29 PM4/20/15
to Robert Flack, Dan Beam, Chromium-dev
I'm sorry to hear you have to battle with 2nd world level internet access.

M-A

cathie chen

unread,
Aug 2, 2019, 12:15:11 PM8/2/19
to Chromium-dev, mar...@chromium.org

Thanks for sharing!

The patch could be uploaded in my local env by both setting git proxy and tsocks. \o/
I.g.
1. Set git proxy:
git config --global http.proxy socks5://127.0.0.1:1080
git config --global https.proxy socks5://127.0.0.1:1080
2. Run in tsocks:
tsocks git cl upload

在 2015年4月18日星期六 UTC+8下午12:24:53,Dan Beam写道:

Dan Beam

unread,
Aug 6, 2019, 3:29:49 PM8/6/19
to cathi...@igalia.com, Chromium-dev, mar...@chromium.org
On Fri, Aug 2, 2019 at 9:14 AM cathie chen <cathi...@igalia.com> wrote:

Thanks for sharing!

The patch could be uploaded in my local env by both setting git proxy and tsocks. \o/
I.g.
1. Set git proxy:
git config --global http.proxy socks5://127.0.0.1:1080
git config --global https.proxy socks5://127.0.0.1:1080
2. Run in tsocks:
tsocks git cl upload

Cool; thanks for the tip!

-- Dan
 

在 2015年4月18日星期六 UTC+8下午12:24:53,Dan Beam写道:
Hey all,

Is there a way I can upload patches through a SOCKS proxy from the command line?  Currently using a hacky^Wtethered internet connection.

I've tried all kinds of fun stuff, e.g. setting these environment variables:

  http_proxy, https_proxy, HTTP_PROXY, HTTPS_PROXY, SOCKS_SERVER

with all kinds of fun values:

  socks5://127.0.0.1:8080, http://127.0.0.1:8080, s/127.0.0.1/localhost/

and have also tried hacking up depot_tools/git_cl.py with 2 version of socksipy[1] which generally results in:

  urllib2.URLError: <urlopen error unknown url type: socks5>

Any ideas?

-- Dan

[1] https://code.google.com/p/socksipy-branch/

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/edb72e52-cebb-4733-8dcb-e96e17cb8b2c%40chromium.org.
Message has been deleted

cathie chen

unread,
Aug 7, 2019, 11:13:20 AM8/7/19
to Chromium-dev, mar...@chromium.org


在 2019年8月3日星期六 UTC+8上午12:15:11,cathie chen写道:

Thanks for sharing!

The patch could be uploaded in my local env by both setting git proxy and tsocks. \o/
I.g.
1. Set git proxy:
git config --global http.proxy socks5://127.0.0.1:1080
git config --global https.proxy socks5://127.0.0.1:1080
2. Run in tsocks:
tsocks git cl upload

Hmm,  tsocks seems not quite stable.

`proxychains git push origin HEAD:refs/for/master` works perfectly for me.

BTW, it seems `gclient sync` always fails by SOCKS proxy in my evn. Any advice?
Thanks:)
Reply all
Reply to author
Forward
0 new messages