नोट: यहां पैच 2015 में संस्करण 2.4.11 के लिए गिट पर लागू किया गया था। उस समय के बाद से आप बस मोज़े का उपयोग कर सकते हैं: // url http.proxy कॉन्फ़िगरेशन सेटिंग्स के साथ।
Git के लिए: // प्रोटोकॉल में हमारे पास SOCKS प्रॉक्सी के साथ Git का उपयोग होता है । हालाँकि, ऐसा प्रतीत होता है कि git ठीक से मोज़े परदे के पीछे का समर्थन नहीं करता है। git ही libcurl से जुड़ा हुआ है। तो .curlrc फ़ाइल का उपयोग नहीं किया जाता है (जो कि कर्ल कमांड लाइन क्लाइंट के लिए है)। हालाँकि, निम्न पैच आवश्यक समर्थन प्रदान करता है। इस पैच के साथ जिसे लागू करने के लिए हम केवल ALL_PROXY पर्यावरण चर या HTTP_PROXY या HTTPS_PROY को सेट कर सकते हैंsocks://hostname:portnum
HTTPS_PROXY (या मोज़े / मोज़े 5) या वास्तव में http.proxy git config सेटिंग में सेट कर सकते हैं और libcarl अब वास्तव में प्रॉक्सी का उपयोग करते समय मोज़े प्रोटोकॉल का उपयोग करेंगे।
उदाहरण के लिए, एक सक्रिय ट्रेस:
$ GIT_CURL_VERBOSE=1 bin-wrappers/git -c "http.proxy=socks://localhost:1080" ls-remote http://github.com/patthoyts/tclftd2xx.git
* Couldn't find host github.com in the _netrc file; using defaults
* About to connect() to proxy localhost port 1080 (#0)
* Trying 127.0.0.1...
* connected
* SOCKS4 request granted.
* Connected to localhost (127.0.0.1) port 1080 (#0)
> GET /patthoyts/tclftd2xx.git/info/refs?service=git-upload-pack HTTP/1.1
User-Agent: git/1.8.1.msysgit.1.dirty
... and on to a successful request ...
आवश्यक पैच:
diff --git a/http.c b/http.c
index 3b312a8..f34cc75 100644
--- a/http.c
+++ b/http.c
@@ -322,6 +322,14 @@ static CURL *get_curl_handle(void)
if (curl_http_proxy) {
curl_easy_setopt(result, CURLOPT_PROXY, curl_http_proxy);
curl_easy_setopt(result, CURLOPT_PROXYAUTH, CURLAUTH_ANY);
+#if LIBCURL_VERSION_NUM >= 0x071800
+ if (!strncmp("socks5", curl_http_proxy, 6))
+ curl_easy_setopt(result, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
+ else if (!strncmp("socks4a", curl_http_proxy, 7))
+ curl_easy_setopt(result, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4A);
+ else if (!strncmp("socks", curl_http_proxy, 5))
+ curl_easy_setopt(result, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4);
+#endif
}
return result;