Advertisements

Blog Archives

how to see active internet connections

Screen Shot 2015-12-03 at 15.55.56.png

I was playing around with some ways of detecting active network connections to add as a function in one of my apps — didn’t really work out, so far — but as I was prototyping the code in AppleScript I came up with this little ditty which some of you might be able to make use of:

1. Open the Script Editor

2. Paste the code below into it and hit ‘Run’

#start of script

on getConnections()

set theCmd to "lsof +c 0 -i -n | grep -i established | cut -d \" \" -f 1 | awk '!_[$0]++'"

set theMsg to (do shell script theCmd)

display dialog "The following apps & processes are actively using your internet connection: " & return & return & theMsg with title "Net Tattler" buttons {"Refresh", "OK"} default button "OK"

set theRes to button returned of the result as string

if theRes = "Refresh" then

getConnections()

end if

end getConnections

getConnections()

#eof

 

If you need more information than just the names of the process, you can play around in Terminal with lsof -iHere’s a great little tutorial.

For something a bit more heavy-duty, check out either Little Snitch or Charles Web Debugging Proxy, both of which are paid-apps but offer free trials. If even those aren’t enough to satisfy your network monitoring desires, head on over to MurusFirewall.com and check out their packet filter GUI offerings for the Mac.

Enjoy 🙂

 

Acknowledgements

Thanks to the folks over at Etresoft for additional suggestions.

Advertisements

Transmission – Port is closed

I don’t often get into 3rd-party software or non-Mac hardware issues, but here’s a little trick I discovered today that could prevent a situation that adversely affects Safari and other network software.

Not so long ago I bought a new router, and everything was working fine. However, when I recently fired up Transmission, I found that not only were my downloads not so fast as I’d normally expect, but that all internet browsing was completely throttled. Basically, Safari would just get stuck half way into loading a page and eventually timeout. Killing Transmission would immediately restore Safari’s connectivity.

Looking in Transmission’s preferences ‘Network’ pane revealed that the port was either closed (red button) or the port could not be checked (yellow button). Now there are a number of reasons this can happen, but since I knew nothing had changed except my router since the last time Transmission was successfully used, I decided to go check out some of the router’s settings.

To do this, quit Transmission if it’s running, then enter your router’s IP address in Safari’s search bar. Typically, this will be something like 192.168.1.1, but if you’re not sure, you can find your router’s IP using my free utility ‘FastTasks‘.

Once you’re in your router’s admin pages, look for Advanced network settings. In my router, I found a bunch of firewall and network protocols (see the first screenshot below). Neither disabling NAT nor UPnP had any effect (those were my first thoughts about the likely culprit), but turning off the ipSec PassThrough option sure did, with the upshot that Safari and Transmission are not only playing nicely together again, but Transmission’s download speeds have markedly improved. 🙂

Here’s the settings I used to get back up and running; see if you can find similar options if you’re experiencing the same problem.

Turning off ‘ipSec PassThrough’ in my Router’s Advanced Settings:

router settings

Transmission’s Network Preferences pane:
transmission network prefs


%d bloggers like this: