w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
creating a forward https proxy using http-node-proxy
There are https options which must be specified when handling the https traffic. Here is what I am doing in my proxy setup. var fs = require('fs'), httpProxy = require('http-proxy'); var proxyTable = {}; proxyTable['domain.com'] = 'localhost:3001'; proxyTable['domain.com/path'] = 'localhost:3002'; proxyTable['sub.domain.com'] = 'localhost:3003'; var httpOptions = { router: proxyTable }; var httpsOptions = { router: proxyTable, https: { passphrase: 'xxxxxxx', key: fs.readFileSync('/path/to/key'), ca: fs.readFileSync('/path/to/ca'), cert: fs.readFileSync('/path/to/crt')} }; httpProxy.createServer(httpOptions).listen(80); httpProxy.createServer(httpsOptions).listen(443); The documentation for https is on their github page as well. https

Categories : Node Js

How To Find Proxy is Http or Socks
No, the proxy type is not based on port numbers. The ports are assigned by network admins and can be anything they want. Your only hope is if your network is configured to use some type of proxy auto-config to provide the specific proxy details to clients when needed. Otherwise, there is no way to query the proxy itself. You have to know ahead of time what type of proxy it is so you know how to communicate with it correctly.

Categories : Http

Unable to tunnel through proxy. Proxy returns "HTTP/1.1 407 Proxy Authorization Required"
You may not need the domain in front of the username. I had a very similar issue, and I fixed it when I removed the domain in front of the username. Since the proxy server is on a domain, I think it implies that your under the same domain.

Categories : Java

Proxy with HTTP Requests
I was able to add a proxy to HttpClient, HttpWebRequest and HttpRequestMessage. They do not have to be used together, but I just found two ways of making HTTP Requests with proxy. To do this in windows store/metro applications, you would have to implement IWebProxy. Take a look at this for implementing IWebProxy: http://social.msdn.microsoft.com/Forums/windowsapps/en-US/6e20c2c0-105c-4d66-8535-3ddb9a048b69/bug-missing-type-webproxy-cant-set-proxy-then-where-is-the-appconfig Then all you need to do is set the proxy for HttpClient or HttpWebRequest: HttpClient: HttpClientHandler aHandler = new HttpClientHandler(); IWebProxy proxy = new MyProxy(new Uri("http://xx.xx.xx.xxx:xxxx")); proxy.Credentials = new NetworkCredential("xxxx", "xxxx"); aHandler.Proxy = proxy; HttpClient client = new

Categories : C#

Is it secure to rewrite proxy a https url to http?
If www.somesite.com is hosted on the same server that the rule is being applied on, then it's network traffic is never leaving the server. That means a 3rd party not on the server won't be able to "eavesdrop" the contents of the request and response (or masquerade as a trusted party) so it doesn't matter if it's unencrypted. The assumption here is that if someone can get access to this traffic, they've already compromised the server so the reverse proxy may be the least of your worries.

Categories : Htaccess

HTTP Proxy using Connect and node-http-proxy
Local server is getting stuck because the middleware does not delegate handling of cases when the if condition fails further down the middleware chain : The following should solve the problem : .use(function(req, res, next) { if (req.url.indexOf(endpoint.prefix) === 0) { proxy.proxyRequest(req, res, endpoint); } else next(); })

Categories : Node Js

HTTP POST converting to HTTPS GET on redirect by proxy server
If the client gets an HTTP 303 See Also code, it will unconditionally submit a GET request. If the client gets an HTTP 302 Found, it should submit the same type of request (POST) on the redirected URL, with user confirmation. This may not work properly on older browsers which tend to treat 302 Found as if it were 303 See Also. Anyway, having a form on a non-secure page submit data on a secure page is a bad idea. The form page may be corrupted and spied in any way you can imagine, and the user cannot be sure that the data he submits is the data he sees. Example: Your form has a "MainData" field. An intermediate phishing site can write a JavaScript to spy entered data, put a hidden "MainData" field containing whatever it wishes and show a dummy "FakeIgnoreData" field to the user. Solutio

Categories : Internet Explorer

How to create a HTTPS Proxy Server on Debian
https involves encryption of the data using an asymmetric (private/public) key that identifies the webpage, based on it's hostname. therefore, you cannot build a transparent https-proxy - unless you have the private keys for all the https:// servers out there (or at least those you want to access through the proxy), which is highly unlikely. if you do have those keys (e.g. because you only want to provide https:// access to an ordinary http:// server that lives somewhere behind a firewall), check out the mod_proxy module for apache.

Categories : Linux

Use JMeter HTTP Proxy to record JSON over HTTP request from not-a-browser client
You can see my question and the answer I got below: Use Jmeter proxy to record HTTP calls from iOS simulator In short: With this tutorial you can record calls from your Android device: http://blazemeter.com/blog/load-testing-mobile-apps-made-easy For make same thing with iPhone, do the following steps: Mac configuration: system preferences -> Network -> Advanced.. -> Proxies -> check "Web Proxy (HTTP) ->in "Web Proxy Server" field, type your IP (http://www.wikihow.com/Find-Your-IP-Address-on-a-Mac), and choose available port (I using 8080) ->ok -> Apply iPhone configuration: Settings -> WiFi -> choose same wifi you use with your Mac -> press on it again to go to it's details -> scroll down ->In HTTP proxy, choose Manual -> server = your mac IP you found earlier -> port = the port yo

Categories : Http

Unable to make https requests via proxy using,php and curl
Try changing: curl_setopt($handle, CURLOPT_PROXYPORT, 80); to: curl_setopt($handle, CURLOPT_PROXYPORT, 443); Since https traffic is on port 443.

Categories : PHP

How to send node.js http request via proxy (using require('http').request method)
According to http://nodejs.org/api/http.html#http_http_request_options_callback hostname: To support url.parse() hostname is preferred over host Should add this line when overwriting proxy informations. options.hostname = proxy.hostname;

Categories : Node Js

Set user-agent for http requests for libraries which do not expose this setting?
If I got your question right, then you can send User-Agent alongwith request headers. h = httplib2.Http(".cache") resp, content = h.request("https://example.org/chap/2", "PUT", body="This is text", headers={'User-Agent':'my user agent'} )

Categories : Python

SOCKS Proxy connection in iOS App
proxychains might help you running the application in android using socks proxy. It is a c library and overloads connect() routine of glibc. So any application requesting tcp connection goes through it. I run my applications using this. for example 'proxychains java someclass'.

Categories : Iphone

Socks proxy in android
As far as I know, Android doesn't support SOCKS proxy out of the box, but you can try installing Privoxy, which can act as a HTTP proxy, and it can use a SOCKS upstream proxy. (I used it to hook up the Android emulator to TOR.) You can then set up a HTTP proxy using the UI (so it can be even used on a real phone, not just the emulator). For more information, see my blogpost about Android and TOR.

Categories : Android

Using Socks 4/5 proxy in Java?
Use URL.openConnection(Proxy) followed by URLConnection.getInputStream().

Categories : Java

How to set proxy while using camel-http
After a few attemps, I managed to have it worked... looks like the problem did not come from my solution, but from the fact I did not increment the bundle version... thus, my solutions were just not taken into consideration. So, the solution that worked for me is setting the endpoint for the context from my routeBuilder, like : getContext().setProperty("http.proxyHost",10.100.100.1); getContext().setProperty("http.proxyPort",2111); Now, it does work. Thanks for those who had a look!

Categories : Http

Python version of ssh -D (SOCKS proxy over SSH)
I have a workaround that works for scraping. Instead of trying to use the SSH connection, I'm using the remote shell to pull out the data: from bs4 import BeautifulSoup import paramiko ssh = paramiko.SSHClient() ssh.load_system_host_keys() ssh.connect('example.com', username='Oli', look_for_keys=True, timeout=5) stdin, stdout, stderr = ssh.exec_command('/usr/bin/wget -qO- "%s"' % url) soup = BeautifulSoup(stdout) ssh.close() This isn't what I was looking for to begin with (and I'd still very much like to see if there's a way of connecting a SOCKS socket in over SSH) but there is some elegance in its simplicity.

Categories : Python

Sending UDP packets through SOCKS proxy
It is possible. You have to specify value 0x03 in field 2 of your client's connection request according to wikipedia description of SOCKS5 protocol. The client's connection request is field 1: SOCKS version number, 1 byte (must be 0x05 for this version) field 2: command code, 1 byte: 0x01 = establish a TCP/IP stream connection 0x02 = establish a TCP/IP port binding 0x03 = associate a UDP port field 3: reserved, must be 0x00 field 4: address type, 1 byte: 0x01 = IPv4 address 0x03 = Domain name 0x04 = IPv6 address field 5: destination address of 4 bytes for IPv4 address 1 byte of name length followed by the name for Domain name 16 bytes for IPv6 address field 6: port number in a network byte order, 2 bytes As Hasturkun pointed out Your code doesn't work because you aren't sending a co

Categories : C++

Mojolicious - acting as an http proxy
Ok, strange. This works. sub handle { my $self = shift; my $app = shift; my $tx = $app->tx; my $req = $app->req->clone; $log->debug("upstream host is " . $self->{upstream_host}); $log->debug("upstream port is " . $self->{upstream_port}); $req->url->scheme("http") ->host($self->{upstream_host}) ->port($self->{upstream_port}); $log->debug("req: " . $req->to_string); $log->debug("req host:port " . $req->url->host . ":" . $req->url->port); my $ua = Mojo::UserAgent->new; my $tx = $ua->start(Mojo::Transaction::HTTP->new(req => $req)); $app->render(data => $tx->res->body); } I'm trying to see how that's significantly different from what

Categories : Perl

Eclipse (STS) HTTP Proxy Configuration
The same thing just happened to me on installing STS 3.4. I could only get the proxy to work by switching my proxy provider to manual, editing the http schema and adding my proxy username and password. Less than ideal. If I remove STS, the native proxy provider starts working again.

Categories : Eclipse

Mangle http without using a proxy (ARP Spoofing?)
I found a tool that will handle this perfectly including ssl negotiation: http://mitmproxy.org/doc/certinstall/android.html It was android I'm testing but it's a general problem.

Categories : Android

What to do with extra HTTP header from proxy?
The proxy issue is something a lot of scripts are facing. The preferred solution I can find on the internet is to simply add the following lines of code. <?php // cURL automatically handles Proxy rewrites, remove the "HTTP/1.0 200 Connection established" string if (false !== stripos($response, "HTTP/1.0 200 Connection established ")) { $response = str_ireplace("HTTP/1.0 200 Connection established ", '', $response); } ?> Now to add this to the twilio client would be a bit messy indeed. Luckily you can use namespaces to recreate native functions. See the following example. <?php namespace FakeCurl; //create curl_exec function with same name, but its created in the FakeCurl namespace now. function curl_exec($ch) { //execute the actual curl_exec function in the main nam

Categories : PHP

Run http server proxy in android?
I don't understand the question fully so here's the question I am going to be answering. Is it possible to create a HTTP server that allows me to view the source code of a web page. The answer is: yes. Since I don't really develop for Android phones, I'm only going to list out what you should do. So first of all you want to accept a connection from a client. Then you might want to send it back a HTML page containing a form with a website URL field. If you set the method to POST, you will be able to make the URL of any length. Now your server needs to know how to receive the HTTP POST request. I don't really know the HTTP well enough to tell you how the request-response is encoded.

Categories : Java

Node http-proxy find proxied URL
You can use request.url to get the URL of the request. For example, to print the URL to the console before proxying it: app.all('/api/*', function(request, response, next) { console.log('Proxying ' + request.url); return proxy.proxyRequest(request, response, { host: 'foo.com', port: 80 }); });

Categories : Misc

How does HTTP caching works in a proxy server?
Your cache proxy server is already putted into play when a request arrives. Therefore you have the requested resource URL. Then you look in your cache and try to find the cached resource for the requested resource URL, if you cannot find the resource in your cache (or the cache is outdated), you fetch the data from the source. Keep in Mind, that you have to invalidate the cached resource if you receive a PUT, POST or DELETE request.

Categories : Http

HTTP Error 407 Proxy authentication required
I had the same problem. The following worked for me. Authenticator.setDefault(new Authenticator() { protected PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication("username","password".toCharArray()); } });

Categories : Java

Handle HTTP 302 response from proxy in angularjs
Your 302 -Redirect is being handled directly by the browser and there is nothing you can do about it directly. You can, however, use an httpInterceptor to help you along. You'll need to include $httpProvider in your app DI list, and then somewhere in your config function put a reference to it like this: $httpProvider.responseInterceptors.push('HttpInterceptor'); A sample interceptor looks like this: window.angular.module('HttpInterceptor', []) .factory('HttpInterceptor', ['$q', '$injector', function($q, $injector) { 'use strict'; return function(promise) { return promise.then(success, error); }; function success(response) { return response; } function error(response) { var isAuthRequest = (respon

Categories : Angularjs

net/http ignoring system proxy settings
You can get proxy info using ProxyFromEnvironment function. Then you create http client using transport (represented by RoundTripper interface) that has info about your proxy settings: var PTransport RoundTripper = &http.Transport{Proxy: http.ProxyFromEnvironment} client := http.Client{Transport: PTransport} Then you just do http request using the info transport gets from passed function to Proxy struct field. Proxy info will be taken from $HTTP_PROXY environment variable.

Categories : Go

configured http.proxy works for git but not for jgit
You can try and see if an environment variable would work better, with java option like: -Dhttp.proxyHost=myproxyhosturl -Dhttp.proxyPort=8080 -Dhttp.nonProxyHosts=”localhost|mybambooserverurl” As in this question: Dhttp.proxyHost – proxy IP address Dhttp.proxyPort – proxy port Dhttp.proxyUser – user name if HTTP-proxy authentication required; Dhttp.proxyPassword – user password if HTTP-proxy authentication required.

Categories : GIT

HTTP(S) request from Perl over proxy with IO::Socket only
I found the solution myself. I used the module IO::Socket::Socks::Wrapper to redirect all requests to SOCKS5 proxy. I only added on the beginning of my script use IO::Socket::Socks::Wrapper ( { ProxyAddr => 'proxy.addr', ProxyPort => 8876, } );

Categories : Perl

Using node-http-proxy, changing url with proxyRequest
A few solutions that will do this are: Issue a 301 redirect. Use IPTables to DNAT and change the desination address. Use TPROXY to transparently proxy the requests without modifying the packets.

Categories : Node Js

How to redirect all HTTPS requests to HTTP requests?
In the Global.asax file try something like. protected void Application_BeginRequest() { if (Context.Request.IsSecureConnection) Response.Redirect(Context.Request.Url.ToString().Replace("https:", "http:")); }

Categories : Asp Net Mvc

Java : HTTP(S)/WebServices connections through NTLM proxy
It's due to a bug on the underlying implementation. It's described on Java 6 NTLM proxy authentication and HTTPS - has anyone got it to work?

Categories : Java

node.js http-proxy how to set timeout and a handler on request
You may want to try this : proxy.on('error', function(err, preq, pres){ pres.writeHead(500, { 'Content-Type': 'text/plain' }); pres.write("An error happened at server. Please contact your administrator."); pres.end(); });

Categories : Node Js

add http request header an WSO2 proxy service
How can I add this header to my request You should add this as BasicAuth header in your request. If you use SOAP UI, you can see the options to add a SOAPHeader elements where, provide as Authorization :Basic XXX

Categories : Wso2

HTTP: Proxy Authentification Error for nltk.download()
nltk have shifted from the googlecode.com but still most of the resources on web continues to give its reference. update the current data server setting in "/usr/lib/python2.7/dist-packages/nltk/downloader.py" file on line 370 from: DEFAULT_URL = 'http://nltk.googlecode.com/svn/trunk/nltk_data/index.xml' to DEFAULT_URL = "http://nltk.github.com/nltk_data/"

Categories : Python

Transparent SSL/TLS proxy for non-HTTP(S) connections (tool suggestions)
I found a tool called SSLsplit that I believe does the trick. I did not have the time to test it yet, but the man page looks like it can do plain TCP/SSL sockets.

Categories : Security

retrieving time from an ntp server behind an http proxy using Java
The corporate proxy is almost certainly just proxying HTTP traffic (port 80 & 443). NTP uses port 123, which is probably blocked by the company firewall. Which will be why you are getting the SocketException.

Categories : Java

Proxying WebSockets through node-http-proxy doesn't work
The core problem is that the master branch of node-http-proxy is only compatible with node <= 0.8.x (see https://github.com/nodejitsu/node-http-proxy#when-to-use-node-http-proxy): there's a tree that implements support for 0.10.x (see https://github.com/nodejitsu/node-http-proxy/tree/caronte) but it isn't the mainline branch and I haven't found any indication of when it will be merged in and available.

Categories : Node Js

Hiding port number in WordPress URL when using node-http-proxy
I've now got this working in a much simpler way. It turns out my custom routing with my hosts and ports arrays was overkill. I'm not entirely sure why this makes a difference, and whether it is because the following code is reverse-proxy as opposed to a forward proxy, but I went ahead and implemented one of the examples on node-http-proxy's GitHub page which wields the desired results: var options = { hostnameOnly: true, router: { 'www.some-apache-website.co.uk': '127.0.0.1:9000', 'www.some-node-website.co.uk': '127.0.0.1:8000' } }; var proxyServer = httpProxy.createServer(options); proxyServer.listen(80); This effectively (and with much less code) reverse-proxies the sites based on the host name. The result is that my WordPress site (sitting behind the Apache server) no

Categories : Wordpress



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.