1

I'm forced to use Processing 2 behind a proxy. My problem is: How can I set host and port of the proxy? I search the settings used by the IDE, e.g. to add libraries or tools. My question is about the usage of a proxy in applications to be developed.

Stefan
  • 133
  • 1
  • 6
  • I'm guessing you're using TCP sockets ? What operating system are you on ? – George Profenza Jun 08 '15 at 09:54
  • @George Windows 7 and Java 8. The correct proxy is already set in Windows system settings. – Stefan Jun 08 '15 at 11:30
  • If you're proxy works fine using a browser for example, hopefully it should work fine using Processing too. Could it be the Firewall blocking it ? (Usually you get a dialog on windows asking for firewall permissions on public or private network, but you should be able to add your exported Processing app to the list of firewall exceptions from the Windows Control Panel Firewall settings) – George Profenza Jun 08 '15 at 14:36
  • @George in my browsers (Firefox and Chrome) I entered the proxy settings manually. My question is, where/how can I set the settings in Processing? – Stefan Jun 09 '15 at 06:22

3 Answers3

2

The solution is given in this document: https:Processing's default settings

The proxy settings for Processing (the application itself) can be set in the file Users -> [username] -> AppData -> Roaming -> Processing -> preferences.txt (Windows 7 and higher) You have to add the values for the keys proxy.host and proxy.port.

Stefan
  • 133
  • 1
  • 6
0

It's probably easier to look for a solution in plain Java and you should be able to apply the same solutions in Processing (if you're using the Java Mode).

Unfortunately I won't be able to test, but these related answers seem to address your proxy issue, for example: How do I set the proxy to be used by the JVM

I'd try this in setup() first:

System.setProperty("java.net.useSystemProxies", "true");

Only because it looks very simple. This is the 4th answer on the page. If it doesn't work I'd move towards the top. If you want to do this straight from Processing you probably need to this programatically at runtime. If neither of the programmatic runtime options work, you should be able to export your sketch from Processing, then run generated the .jar from command line, passing the proxy settings as well.

Although a long stretch, if drawing some graphics on screen is all you need, you can move from Java to JavaScript with P5.js

Community
  • 1
  • 1
George Profenza
  • 50,687
  • 19
  • 144
  • 218
  • Thanks for the elaborate answer, but I think it is not the right one for my question. The question was, how to set the proxy used by Processing, e.g. for updates or download of libraries. – Stefan Jun 10 '15 at 11:34
  • I see, sounds more like a windows 8 proxy settings questions than Processing/java per se. Searching should give you handy results like [1](http://www.thewindowsclub.com/setup-proxy-metro-application-windows-8),[2](https://support.microsoft.com/en-us/kb/2777643),[3](http://superuser.com/questions/489527/how-can-i-configure-proxy-settings-for-all-apps-system-ie-etc)...etc. Worst case scenario, you can always download libraries and tools through the browser – George Profenza Jun 10 '15 at 16:27
0

This is an ongoing problem with all versions of Processing. For anyone else with this issue in Windows: Processing is unable to run even a single line of code unless it has an internet connection, no idea why this should be the case. If you are behind a proxy there are (at least) two ways to add proxy settings. You can do it per user in c:\users\\appdata\roaming\Processing\preferences.txt or for all users under the main processing folder (will vary with version) in the lib folder, default.txt. This file says something about "do not edit". Take a backup first if you're concerned, but you can scroll down and edit the proxy settings there easy enough. when a user runs Processing for the first time, these settings will be put into their preferences.txt. If they already have a preferences.txt, you will need to delete or rename it, and a new one will be created at next use. For a student lab situation, you can copy out this default.txt file to the \lib on all machines, and it will then work for all users.

marfl
  • 1