RSS

Java Networking: Enabling your app to access internet through a proxy server

28 Jun

So in my earlier blog post I made a web browser and all, and the first problem I encountered was getting it to connect to the internet. Why this is a problem is because I access the internet through a proxy server. Most institutions have proxies and can only access the internet at a particular port so its kind of nice to let them connect. Its just 3 lines of code:

System.getProperties().put("proxySet","true"); //Tells java that you'll be connecting through a proxy
System.getProperties().put("proxyHost","10.223.0.2"); // and the port the server is listening in
System.getProperties().put("proxyPort","3128"); //specifies the servers ip

 

 
Leave a comment

Posted by on June 28, 2012 in Code, Java

 

Tags: ,

Leave a comment