We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › Acessing web site from a computer behind a proxy
Page Index Toggle Pages: 1
Acessing web site from a computer behind a proxy (Read 1222 times)
Acessing web site from a computer behind a proxy
Feb 4th, 2009, 12:49pm
 
Hi,

I wrote a program visualizing news from a certain web site. I used the command loadStrings("www....") for accessing the web site and it works well when my computer is directly connected to the internet or connected by a transparent proxy. But using my program on a computer behind a non-transparent proxy produces: "The file "www...." is missing or inaccessible, make sure the URL is valid or that the file has been added to your sketch and is readable" (pretty much the same as you try to use the program without any internet connection).

Is there the possibility to cope with the proxy in Processing in an easy way?  

I searched in this forum but only found two more threads mentioning the same problem but did not provide a solution Wink

http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Syntax;action=display;num=1219847419;start=0#0

http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Syntax;action=display;num=1219242873;start=12#12
Re: Acessing web site from a computer behind a pro
Reply #1 - Feb 4th, 2009, 12:57pm
 
You could try something like:

Code:
import java.util.Properties;
//...

//in setup..
Properties systemSettings = System.getProperties();
systemSettings.put("http.proxyHost", "myProxyServer.com");
systemSettings.put("http.proxyPort", "80");
System.setProperties(systemSettings);

Re: Acessing web site behind a proxy
Reply #2 - Feb 15th, 2009, 4:16pm
 
Hi,

I confirm the above works (tested with a specific URL, that appeared in the proxy log). Since it can be very useful to know this, maybe this should be moved to the documentation?

There's one catch however: if the proxy is incorrectly set, the program will try to access the document through direct connection. This can be an undesired side-effect if a project is proxy-dependent (eg you want your code to go through the proxy and not through direct access). I haven't found a workaround for that yet.

Cheers,

mathieu


Re: Acessing web site from a computer behind a proxy
Reply #3 - Sep 28th, 2009, 1:51am
 
I had that problem too, it's fixed: a whole new world of possibilities opens! thanks!!!
Page Index Toggle Pages: 1