Bug - Not A Bug Proxy settings disabled on macOS

Malibu Stacey

Active member
Not sure if this a bug or expected behaviour but I can't modify the proxy settings when running on macOS.
All the controls on the page are disabled including the enable checkbox.
Manually setting the values for
Code:
http.proxyHost=
http.proxyPassword
http.proxyPort=
http.proxyUser
https.proxyHost=
https.proxyPassword
https.proxyPort=
https.proxyUser
in GLOBAL_prefs.txt likewise does nothing.

I can't set Java proxy settings on macOS directly as the Java control panel is no longer a thing as of Java 11

Any help in my endeavour to play KoL when I'm supposed to be working is greatly appreciated :D
 

Saklad5

Member
In the interim, I recommend using a system-wide proxy, possibly even Tor. There’s no kill like overkill.
 

fronobulax

Developer
Staff member
The GUI elements behave as expected for me in Windows. I might toggle proxySet between start and restart and see if something changes but it sounds like something has changed that has an effect on the GUI and I have no idea where I would begin.

Have you tried editing globals to have the values you want and proxySet to be true? If it is merely a GUI issue KoLmafia should use the values.

I would check your employeer's IT policies. I have worked in environments where getting caught using TOR or a global proxy on a machine was grounds for immediate dismissal and the level of monitoring and network topology allowed for some chance of getting caught.
 

lostcalpolydude

Developer
Staff member
Code:
			if ( System.getProperty( "os.name" ).startsWith( "Mac" ) )
			{
				this.optionBoxes[ 0 ].setSelected( proxySet );
				this.optionBoxes[ 0 ].setEnabled( false );
			}
So it is intentionally disabled for Macs. I have no idea why that was, or if it makes any sense.

I see that
Code:
global	http.proxyHost
global	http.proxyPassword
global	http.proxyPort
global	http.proxyUser
global	https.proxyHost
global	https.proxyPassword
global	https.proxyPort
global	https.proxyUser
appear to be all of the potentially-relevant settings.
 

fronobulax

Developer
Staff member
Duh. I was assuming this was something that had stopped working.

Edited to add something useful:

Looking at the code it looks like KoLmafia punts everything related to a proxy on a Mac to the global Java properties. So if you want to use a proxy on a Mac you need to set them.

If you can't set them any other way the -D command line switch is the way to go.

java -Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=3128 etc...
 
Last edited:

Saklad5

Member
I mean, you can use bridges to circumvent such monitoring, but it is still probably worth asking on principle. And rethinking whether you should be playing KoL at work, to be honest.
 

Malibu Stacey

Active member
Code:
			if ( System.getProperty( "os.name" ).startsWith( "Mac" ) )
			{
				this.optionBoxes[ 0 ].setSelected( proxySet );
				this.optionBoxes[ 0 ].setEnabled( false );
			}
So it is intentionally disabled for Macs. I have no idea why that was, or if it makes any sense.

I see that
Code:
global	http.proxyHost
global	http.proxyPassword
global	http.proxyPort
global	http.proxyUser
global	https.proxyHost
global	https.proxyPassword
global	https.proxyPort
global	https.proxyUser
appear to be all of the potentially-relevant settings.

Could it be changed to not be disabled on macOS so I can test it?

If you can't set them any other way the -D command line switch is the way to go.

java -Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=3128 etc...

Tried that already, requires the full JDK installed on macOS not just the JRE which I'd rather not unless absolutely necessary.

In the interim, I recommend using a system-wide proxy, possibly even Tor. There’s no kill like overkill.

I mean, you can use bridges to circumvent such monitoring, but it is still probably worth asking on principle. And rethinking whether you should be playing KoL at work, to be honest.

Yeah now I see why the consensus is what it is around these parts. Sometimes it takes a while to come around the same point of view as the group but I guess it happens eventually.
 

fronobulax

Developer
Staff member
If no one else does I can comment the lines out and post a jar file for you but it won't happen immediately. I note that the code dates back to hola and 2006 and 2012 so there may have been a MacOS issue with proxies that is no longer the case, but I am unwilling to change the codebase without more understanding and testing on this point.

I played KoL at work when I could. I didn't play when I couldn't. The ethics really depend upon your job and your employer. In the most extreme case I worked in, games on corporate equipment were prohibited and grounds for dismissal. Attempting to circumvent that policy was also grounds for dismissal. All traffic was monitored and if VPN or bridge or proxy use was detected it was deemed as "circumventing". Accessing the equipment in that environment required explicit consent to monitoring and if potentially circumventing traffic was observed a keystroke logger was installed to see what was going on (and detection algorithms possibly enhanced as a result). If your cubicle mate was concerned about what you were doing a logger was also a possibility. So I am a firm believer in playing by the rules (because I am not smart enough to get around them) and working to change them when they got in the way of doing my job. Tangentially, these policies were not in place just to keep employee's noses to the grindstone but the folks doing enforcement spent more time dealing with attempted access to games, gambling and porn than anything else.
 

Malibu Stacey

Active member

Malibu Stacey

Active member
Code:
			//if ( System.getProperty( "os.name" ).startsWith( "Mac" ) )
			//{
			//	this.optionBoxes[ 0 ].setSelected( proxySet );
			//	this.optionBoxes[ 0 ].setEnabled( false );
			//}
			//else
			//{
				proxySet |= Preferences.getBoolean( "proxySet" );
				this.optionBoxes[ 0 ].setSelected( proxySet );
			//}

https://www.dropbox.com/s/f8a3lbi8jjkoyfu/KoLmafia-19208M.jar?dl=0

I'll delete the file in a few days.

So the checkbox worked but nothing else. Couldn't select the text fields to populate any settings & even though they were already manually set correctly (I've verified they work on Windows) it still wouldn't use them.

Thanks for trying frono.
 

fronobulax

Developer
Staff member
Ok. I am going to assume that disabling the proxy on a Mac was deliberate because of some Mac characteristic. It would be nice to know more but...

I guess this is not a bug as much as a FR but in either case no code is changing now.
 
Top