Want to highlight a helpful answer? Upvote!

Did someone help you, or did an answer or User Tip resolve your issue? Upvote by selecting the upvote arrow. Your feedback helps others! Learn more about when to upvote >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

MacOS Parental controls seem to block access to localhost, and possibly also to 127.0.0.1

Hi


Our MacOS app runs its only web server on port 8080, but recently we've noticed some users complaining that the app no longer works.


The problem seems to be that that when parental controls are enabled, with web filtering, that the App can't access its own web server on localhost:8080


I've tried whitelisting locahost, localhost:8080, 127.0.0.1 and 127.0.0.1:8080, but it doesn't solve the problem.


Whats strange is the users under parental controls, don't get prompted to allow access to locahost or 127.0.0.1, but when our app attempts to access our Internet website, the users do get prompted to get the admin to allow this, and our app is then able to access our Internet website


My guess is that, the Parental controls system does not expect users to request pages from localhost, and hence no prompt appears for this.


I also suspect the only way to fix this may be to write a script to update the Managed Preferences (MCX) for the user, so that it allows our app to access localhost:8080 etc


But this seems like a sledghammer to crack a nut :-(


MacBook

Posted on Jul 21, 2019 4:58 PM

Reply

Similar questions

3 replies

Jul 21, 2019 5:36 PM in response to RogerClark2

Can you reproduce this problem on your own machines?


Port 8080 is a somewhat reserved port. 3rd party software should not be using it. There are too many other apps, scripts, and hacks that use that port. It is better to use an ephemeral port.


My app also uses an embedded web server. I haven’t had any complaints about it not working or parental controls. However, the next version will get rid of that internal server and use only in-memory data with a custom protocol. You should do likewise.

Jul 21, 2019 6:04 PM in response to etresoft

The port doesn't seem to be the problem. If the App can't create a server on 8080, it tries 8081 then 8082 etc. However the App always seems to be able to setup the socket server on 8080.


The problem seems to be partially that the name "localhost" doesn't seem to be resolved under some instances, but we're still investigating exactly what part of the request to localhost:xxxx is failing.



I think we're stuck with needing to use a IP socket server, because we're using a library which uses WebKit to display the content inside the App, including posting data from Webkit back to the App, and the whole app it has to be cross platform, and the socket server method works on iOS and OSX, and Windows and Android, without needing to write completely different ways of handling the web content on each platform.



Jul 21, 2019 6:47 PM in response to RogerClark2

Doing some more testing, it seems that webkit can't resolve localhost, if Parental Controls : Web site filtering is enabled.


However the web server can be accessed via 127.0.0.1 and also if I open a low level connection to "localhost" the name seems to be resolved OK as well.


So the problem seems to be related to the route webkit uses to resolve "localhost"


We already have some checks in the App to confirm whether it can open a socket to "localhost" but we'll need to change our tests to use Webkit to request to "localhost" since Webkit seems to be doing something different.

MacOS Parental controls seem to block access to localhost, and possibly also to 127.0.0.1

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.