proxy
Doing http requests through a SOCKS5 proxy in NodeJS
I’ve just published two modules that should help you do this: socks5-http-client and socks5-https-client. Just use those instead of the default http module. The API is the same. For example: require(‘socks5-http-client’).request(options, function(res) { console.log(‘STATUS: ‘ + res.statusCode); console.log(‘HEADERS: ‘ + JSON.stringify(res.headers)); res.setEncoding(‘utf8’); res.on(‘data’, function (chunk) { console.log(‘BODY: ‘ + chunk); }); });
seriously simple python HTTP proxy? [duplicate]
“a very simple proxy example that can be connected to and will then itself try to connect to the address passed to it.” That is practically the definition of an HTTP proxy. There’s a really simple proxy example here: http://effbot.org/librarybook/simplehttpserver.htm The core of it is just 3 lines: class Proxy(SimpleHTTPServer.SimpleHTTPRequestHandler): def do_GET(self): self.copyfile(urllib.urlopen(self.path), self.wfile) So … Read more
nginx proxy pass subpaths not redirected
References to nginx docs: HttpCoreModule#location, HttpProxyModule#proxy_pass. There is a better way than using regex (which is slow) for location match. In this case, you could use ^~ to tell nginx to match the given prefix /mail before doing any regex match. You also don’t need that rewrite rule because proxy_pass can do that simple rewrite … Read more
Unable to tunnel through proxy. Proxy returns “HTTP/1.1 407” via https
Change in Java 8 Update 111: Now, proxies requiring Basic authentication when setting up a tunnel for HTTPS will no longer succeed by default. If required, this authentication scheme can be reactivated by removing Basic from the jdk.http.auth.tunneling.disabledSchemes networking property, or by setting a system property of the same name to “” ( empty ) … Read more
How to configure PIP per config file to use a proxy (with authentification)?
Here are the steps how to configure proxy (with auth.) in pip’s config file (pip.ini) (if it does not already exist) Create a folder named ‘pip’ and inside it a file named ‘pip.ini’ as described here: https://pip.pypa.io/en/stable/user_guide/#config-file (location an name may differ per platform – e.g. on Windows it’s %APPDATA%\pip\pip.ini) edit pip.ini file and add … Read more
Apache HttpClient 4.1 – Proxy Authentication
For anyone looking for the answer for 4.3…its fairly new and their example didn’t use the new HttpClientBuilder…so this is how I implemented this in that version: NTCredentials ntCreds = new NTCredentials(ntUsername, ntPassword,localMachineName, domainName ); CredentialsProvider credsProvider = new BasicCredentialsProvider(); credsProvider.setCredentials( new AuthScope(proxyHost,proxyPort), ntCreds ); HttpClientBuilder clientBuilder = HttpClientBuilder.create(); clientBuilder.useSystemProperties(); clientBuilder.setProxy(new HttpHost(pxInfo.getProxyURL(), pxInfo.getProxyPort())); clientBuilder.setDefaultCredentialsProvider(credsProvider); clientBuilder.setProxyAuthenticationStrategy(new … Read more
How can I prevent a base constructor from being called by an inheritor in C#?
There is a way to create an object without calling any instance constructors. Before you proceed, be very sure you want to do it this way. 99% of the time this is the wrong solution. This is how you do it: FormatterServices.GetUninitializedObject(typeof(MyClass)); Call it in place of the object’s constructor. It will create and return … Read more
Docker Nginx Proxy: how to route traffic to different container using path and not hostname
In case if somebody is still looking for the answer. jwilder/nginx-proxy allows you to use custom Nginx configuration either a proxy-wide or per-VIRTUAL_HOST basis. Here’s how can you do it with Per-VIRTUAL_HOST location configuration. Inside your poject folder create another folder – “vhost.d”. Create file “whoami.local” with custom nginx configuration inside “vhost.d” folder. This file … Read more
Can a proxy server cache SSL GETs? If not, would response body encryption suffice?
The comment by Rory that the proxy would have to use a self-signed cert if not stricltly true. The proxy could be implemented to generate a new cert for each new SSL host it is asked to deal with and sign it with a common root cert. In the OP’s scenario of a corportate environment … Read more