Under the hood, this is using nethogs. Here's how nethogs associates traffic with a process:<p>On linux the file /proc/net/tcp lists all established TCP connections. It includes the local and remote socket addresses and the inode number for the local socket. Nethogs uses libpcap to sniff traffic and associate it with its entry in /proc/net/tcp. It takes the inode from there and scans through /proc/*/fd/ looking for the file descripter that has that inode to determine which process has the socket open. Once it finds the process it adds it to a table of inode to process id mappings so it doesn’t have to scan through /proc again the second time a packet for that connection comes through.
Hey, project author here. This is the first python package or project for that matter I've built for my college assignment.<p>I am really overwhelmed by the response. However the project is still very much unifinished.<p>Here are somethings that need to be fixed/added for eg.<p>-fix some bugs on frontend.(proper sort on listing/chart switching etc.)<p>-Kill nethogs process on exit // fails sometimes<p>-Store history for restarts.<p>-proper packaging.<p>-unit tests.<p>I'll add the above to the readme.md<p>First time on Hackernews/Github feed feels great though. Cheers.
If you're on Mac and just want to monitor the connections that each process makes (not the bandwidth), Radio Silence just got a built-in network monitor a few weeks ago: <a href="https://radiosilenceapp.com" rel="nofollow">https://radiosilenceapp.com</a><p>Disclaimer: I'm the author
On OS X I use Little Snitch. Unfortunately, it's not free.<p>I noticed in one of your screenshots you use LS as well, do they serve different purposes or was it just a project for fun?
On Windows: Sysinternals Process Explorer, already mentioned Glasswire and NetBalancer and a bunch of other apps, almost all which aren't very good at all. But Glasswire is very nice.
The final build should have proper shebangs and I also noticed the CSS is a little messy. I'll submit a pull request in a bit.<p>Otherwise I'll give it a shot.
I've been working on a similar python webserver + webview GUI from that used in this repo, but aren't there security concerns of just opening it up to the local network? Aren't you exposing your entire API to any app on the same computer?
NetBalancer is a similar tool for Windows, with interesting functionality, but not free <a href="https://netbalancer.com" rel="nofollow">https://netbalancer.com</a>
would be nice to configure a central server to which to push data to and list the machine name with each entry so you can monitor all machines on a network and see who and what is hogging the bandwidth. Might give it a go