How can I create a simple proxy server in Java?
-
can it be created without socket programming
-
Answer:
You probably will need socket programming. Don't worry though... socket programming is really easy in Java. What you need to do is create a server that binds to a particular port and listens for connections. When it gets a connection, it should read requests. When it gets a request, it should parse it to determine which server/port the request is for. It should then connect to that server, forward the request, wait for a response, and send the response back to the client.
John Kurlak at Quora Visit the source
Other answers
http://examples.oreilly.com/jenut/ProxyServer.javahere's a real simple script from o'reilly for your java proxy server.
Emma Wilson
You could use some existing code for reference. Here's on project: http://www.littleshoot.org/littleproxy/ It uses instead of traditional Java sockets.
Miguel Paraz
Here you go - http://code.google.com/p/free-android-apps/source/browse/trunk/Local+HTTPD/src/com/hax/NanoHTTPD.java?r=15 It even works embedded in an Android app.
Josephus Villarey
Related Q & A:
- How can i create a mobile application server?Best solution by Stack Overflow
- How can i create a new blog?Best solution by Yahoo! Answers
- How can I create a new font?Best solution by Yahoo! Answers
- How can I create a cute, artsy, unique facebook profile?Best solution by Quora
- How can I create a yahoo group?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.