Link to home
Start Free TrialLog in
Avatar of xNejX
xNejXFlag for Canada

asked on

C++ local proxy on 127.0.0.1

Hi Guys,

I need to create a local listener, almost something like a proxy in C++ on 127.0.0.1 with a predefined port ex. 1234. How would I approach this?

The application needs to listen for any data that gets passed to it from lets say Firefox (configured to proxy 127.0.0.1:1234) and forward that request to another location. Lets say if that request is www.google.com than it redirects it to a local search engine.

I found something in C# and HttpListener but nothing in C++ on how I could achieve this functionality.

Thank you for all your help. Any feedback will be appreciated.
Avatar of evilrix
evilrix
Flag of United Kingdom of Great Britain and Northern Ireland image

You can do this without writing code... just add www.google.com to your local hosts file and set the IP address to be that of your local search engine. This will redirect the call as you require.
If you do want to do this as a C++ app you will need to know how to do socket programming. A good place to start is Beej's Guide to Network Programming.

http://www.beej.us/guide/bgnet/
Avatar of xNejX

ASKER

Thanks for the reply, I want and need to do it as an app. I am looking for a more specific guideline on where to focus on.

Thank you,
ASKER CERTIFIED SOLUTION
Avatar of evilrix
evilrix
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial