mfikes / ambly

ClojureScript REPL into embedded JavaScriptCore
http://ambly.fikesfarm.com
Eclipse Public License 1.0
541 stars 21 forks source link

Print a warning if firewall enabled #87

Closed mfikes closed 9 years ago

mfikes commented 9 years ago

If the firewall is enabled and Ambly needs to connect to the simulator, it won't be able to. It looks like this could simply be addressed by checking the value of

defaults read /Library/Preferences/com.apple.alf globalstate

If this prints 0, the firewall is off. If this prints 1, this means the firewall is on, but a dialog will pop up asking for permission. If it prints 2, then this is associated with "Block all incoming connections", and in this case, if Ambly enters the mode where it indicates "Waiting to discover devices..." then it can check for a 2 and warn.

funkotron commented 9 years ago

Nice :+1:

mfikes commented 9 years ago

Thinking about this more deeply, it is difficult to emit such a warning when and only when warranted. It also complicates the code a bit since processing defaults read requires reading and parsing its standard output.

I think if this issue comes up frequently it may be worth trying to do this. For now, let's see and reopen this if needed.

funkotron commented 9 years ago

Perhaps just a note on the readme that strict firewall rules may prevent REPL connection?

On Tue, May 19, 2015, 19:25 Mike Fikes notifications@github.com wrote:

Thinking about this more deeply, it is difficult to emit such a warning when and only when warranted. It also complicates the code a bit since processing defaults read requires reading and parsing its standard output.

I think if this issue comes up frequently it may be worth trying to do this. For now, let's see and reopen this if needed.

Reply to this email directly or view it on GitHub https://github.com/omcljs/ambly/issues/87#issuecomment-103623289.

mfikes commented 9 years ago

@funkotron Yeah. I added and linked this in https://github.com/omcljs/ambly/wiki/Connectivity