What is the difference when connecting through a proxy? - proxy

I know what a proxy is, and the basics of how they work.
What I was wondering is, what is different in a request that goes through a proxy?
I know when I configure Firefox I simply configure the proxy in a dialog. When I program in python I can use an environment variable.
If I am programming in an environment that doesn't already have support for a proxy, how do I connect through a proxy? Is there an extra header added to requests? Is the protocol slightly different?

The protocol is slightly different. Where a direct connection to example.com would say:
GET /index.html HTTP/1.1
a connection through a proxy would say:
GET http://example.com/index.html HTTP/1.1

Related

How to use forward proxy for HTTPS?

I have a use case where I have to put a middle server or relay or tunnel to do network communication with the following points:
I have a web server running, let say when I hit an API /request hosted my web server, it creates a post request to https://www.google.com and gives me a response through the endpoint.
I want a middle server (proxy etc.) which I will call while creating this post request instead of communicating through my webserver,
the call goes to the middle server and gives me the same response as I was getting directly.
For this, the SQUID proxy worked for me.
I came across NGINX, but we can not use NGINX as a forward proxy, also there are some observations that might be useful with this regard.
SQUID proxy also uses the conf file as similar to NGINX,
HTTPS traffic is encrypted, the proxy server need to do some more work to get something with Https requests,
For intercepting, and creating ACL rules, someone will need to have a dummy certificate to be used by the server to act as the owner of the requested content through the proxy,
a list of rules can be incorporated within SQUID.conf to achieve the filtering.
I hope this could be useful to achieve something like this.

How to proxy HTTPS via HTTP without CA or MITM?

HTTP proxy with SSL and DNS support.
I must be lacking some key concepts about proxy-ing because I cannot grasp this. I am looking to run a simply http or https proxy without interfering with SSL. Simply, a fully transparent proxy that can passthrough all the traffic to the browser connected via HTTP or HTTPS proxy without modifying or intercepting any packets. Not able to find any code online or I'm not using the right keywords.
EX. On the browser adding server.someVPN.com:80 on the HTTP proxy field and as soon as you try to visit a website, it prompts for authentication. Then it works perfectly with any domain, any security, any ssl, no further steps needed. Most VPN providers have this.
How's this possible? it even resolves DNS itself. I thought on transparent proxy the dns relies on the client. Preferably looking for a nodeJS solution but any lang works.
Please don't propose any solutions such as SOCKS5 or sock forwarding or DNS overriding or CA based MITM. According to HTTP 1.1 which supports 'CONNECT' this should be easy.
Not looking to proxy specific domains, looking for an all inclusive solution just like most VPN Providers providers.
----Found the answer too quickly, feel free to delete this post/question admins.
The way it works is that the browser knows it is talking to a proxy server, so for example if the browser want to connect to htttp://www.example.com it sends a CONNECT www.example.com:443 HTTP/1.1 to the proxy server, the proxy server resolves wwww.example.com via DNS and then opens a TCP connection to wwww.example.com port 443 and proxies the TCP stream transparently to the client.
I don't know any solution for nodejs. Common proxy servers include Squid, Privoxy and Apache Traffic Server
See also: https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/CONNECT
Found the solution right after I asked...
This module works perfectly https://github.com/mpangrazzi/harrier
Does exactly what I was asking for.

Anonymous proxy from behind another proxy

This question is just coming out of curiosity ...
I am behind a proxy server and am using some anonymous online proxy from behind it.
Can my internal proxy server see what requests i am sending and receiving from the anonymous proxy ? I know that the outside world sees that as if the anonymous proxy is requesting something .. but is it possible that my internal proxy server knows the same requests ?
If the connection between your local machine and the outside proxy is not encrypted, then it is possible that your inside proxy can see the requests that you are making.
TOR (https://www.torproject.org/) solves this problem, by relaying your requests through multiple proxies, using an onion-like encryption scheme where each proxy 'peels off' a layer of encryption one-by-one. This way, only the last proxy can actually see your request, but this proxy has no way of knowing where this request originated from.

Use Charles Proxy to route https request to local http server

I have Charles Proxy set up to look at outgoing https requests, and I need to re-route traffic from one server to a local http server.
I have a MacOSX machine that is set up this way: I have an ethernet connection that I hardwire, and share the internet connection via the airport interface. On a second machine, I've installed the Charles cert, and when I connect via the shared interface. I can see the traffic (unencrypted) in Charles, so I know the communications and certs are all working properly.
I need to intercept all the https traffic going to one server (https://www.foo.com) to a local http server (localhost:8001). I've tried using Map Remote, but it doesn't seem to unencrypt the traffic before forwarding it (or possibly it re-encrypts it).
How can I configure Charles to do this? (or, please point me to any other software package, if Charles isn't capable of this)
I figured out what was happening, there were two issues.
I had misconfigured the Map Remote entry, and my two different clients (MyApp and curl) were hitting two different servers - the app was hitting the correct server (locally) but the request was malformed.
Curl from the macOSX box where the proxy was running was NOT looping through the proxy, since I hadn't included the -x localhost:8888 flag.

Open source HTTP or HTTPS proxy

I want to log all HTTP requests made by the browser to a file, so I thought I can run a HTTP/S proxy locally and do this. However, the proxies at proxies.xhaus.com/ don't meet my needs - either no HTTPS support or no logging. Do anyone of you know of a proxy that can do both HTTPS and HTTP and allow me to log the browser traffic to a file?
Squid can do that.
http://wiki.squid-cache.org/Features/SslBump
Squid was also my first thought given your description, but for development use you might prefer a more powerful intercepting proxy like:
Fiddler2
Paros Proxy
Burp Suite (despite the name, my personal favorite)

Resources