LIttle Proxy as a "Pass Through"

1,325 views
Skip to first unread message

Will Smelser

unread,
Jan 2, 2014, 2:23:58 PM1/2/14
to littl...@googlegroups.com
I want to use LIttleProxy more as a passthrough to map requests to external requests.  So no actual CONNECT header type of stuff.

For example:
maps to...

The main goal is we utilize 3rd party content that use our IP address for authentication purposes.  Would this be easy enough to do with LittleProxy or am I better off starting with just a netty or tomcat webserver?

Thanks,
   Will

Ox Cart

unread,
Jan 3, 2014, 7:28:37 AM1/3/14
to littl...@googlegroups.com
So you want to implement fake DNS names that get mapped to real DNS names by the proxy?  That should be very doable using a requestPre filter, as seen in this test.  You'll just need to alter the Host header.

Will Smelser

unread,
Jan 8, 2014, 6:25:06 PM1/8/14
to littl...@googlegroups.com
Not really, what I am looking for is more like just a normal web server.

Imagine I have a wildcard DNS entry for *.MyDomain.com.

Now I want to make a request to goggle.com.MyDomain.com, and then return the content from http://www.google.com.

So I wouldn't be connecting to little proxy using normal proxy protocol, just make a normal HTTP request.

Thanks,
   Will

Ox Cart

unread,
Jan 8, 2014, 10:48:02 PM1/8/14
to littl...@googlegroups.com
Hi Will,

As long as you're not using HTTPS, there shouldn't be any difference between proxying traffic through an HTTP proxy like LittleProxy and simply making a request to it.  Either way, your client opens a TCP connection to LittleProxy and then starts sending it HTTP traffic.

You'll still need to create a filter as I described to rewrite the host header.  By rewriting it in the requestPre method, you'll cause LittleProxy to see the rewritten host header which will get it to connect to that server.


Cheers,
Ox

-----------------------------------------------------------------------------------------

"I love people who harness themselves, an ox to a heavy cart,
who pull like water buffalo, with massive patience,
who strain in the mud and the muck to move things forward,
who do what has to be done, again and again."

- Marge Piercy



--
You received this message because you are subscribed to a topic in the Google Groups "LittleProxy" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/littleproxy/EuRuDrrOaZY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to littleproxy...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Will Smelser

unread,
Jan 9, 2014, 11:20:18 AM1/9/14
to littl...@googlegroups.com
Ok I get it now.  I need to parse the request and add/remove the headers myself.

For example:
client makes request to http://google.com.MyDomain.com

#Incoming Headers

#Headers after modifying using requestPre
GET http://google.com HTTP/1.1
Host: google.com

Then Little Proxy will take care of the rest.

Now the reason I cannot use HTTPS because this header will be garbage (encrypted)?  Is there a way around this as HTTPS support is necessary.

Thanks,
   Will

Ox Cart

unread,
Jan 9, 2014, 11:28:44 AM1/9/14
to littl...@googlegroups.com
Hi Will,

Netty already parses the Http protocol for you.  In your filter, just use the the headers() method of the HttpRequest object to inspect and modify headers.

To make what you're trying to do work with HTTPS, you will need to man-in-the-middle the request.  This will cause certificate errors on your client, though.

See https://github.com/adamfisk/LittleProxy/issues/79 for more information on MITM.


Cheers,
Ox

-----------------------------------------------------------------------------------------

"I love people who harness themselves, an ox to a heavy cart,
who pull like water buffalo, with massive patience,
who strain in the mud and the muck to move things forward,
who do what has to be done, again and again."

- Marge Piercy



Will Smelser

unread,
Jan 9, 2014, 3:18:37 PM1/9/14
to littl...@googlegroups.com
Thanks for the information.  Ill spend the next few weeks playing around with things before I ask too many questions.  Again, I appreciate the input.

Thanks,
   Will

Ox Cart

unread,
Jan 9, 2014, 3:29:30 PM1/9/14
to littl...@googlegroups.com
You're welcome!


Cheers,
Ox

-----------------------------------------------------------------------------------------

"I love people who harness themselves, an ox to a heavy cart,
who pull like water buffalo, with massive patience,
who strain in the mud and the muck to move things forward,
who do what has to be done, again and again."

- Marge Piercy



Reply all
Reply to author
Forward
0 new messages