Comments (6)
Hmm. Does netstat -aon | findstr :1281 | findstr LISTENING
work directly from the command line?
from porthog.
Thank you for your response, I'm not sure what is going wrong here but here is the output from the both porthog and command line for the same port:
netstat -aon | findstr :80 | findstr LISTENING
TCP 0.0.0.0:80 0.0.0.0:0 LISTENING 4
TCP 0.0.0.0:8081 0.0.0.0:0 LISTENING 2544
TCP [::]:80 [::]:0 LISTENING 4
TCP [::]:8081 [::]:0 LISTENING 2544
porthog 80
PORT PID PROCESS
--------------------------------------------------
80 - -
and here's the output for a different port:
netstat -aon | findstr :6060 | findstr LISTENING
not found
porthog 6060
child_process.js:508
throw err;
^
Error: Command failed: netstat -aon | findstr :6060 | findstr LISTENING
at checkExecSyncError (child_process.js:465:13)
at execSync (child_process.js:505:13)
at module.exports.stdout.forEach.Object.keys.forEach (C:\Users\mattjs\AppData\Roaming\npm\node_modules\porthog\index.js:15:16)
at C:\Users\mattjs\AppData\Roaming\npm\node_modules\porthog\cli.js:15:15
at Array.forEach (native)
at Object.<anonymous> (C:\Users\mattjs\AppData\Roaming\npm\node_modules\porthog\cli.js:14:6)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
from porthog.
I tracked down and fixed the issue. There was a small uncaught issue with the parser when nothing is running on a specific port. It's been fixed and the updated module has been released on npm as version 0.0.5
.
Thanks for reporting this and helping troubleshoot it!
from porthog.
Awesome, working again.
Thank you for fixing it, you rock 🤘 .
On a different note, shouldn't it also include the results for ports with "Established" status reported by netstat?
from porthog.
I totally forgot about following-up on this with a comment (sorry). Porthog should not provide results for ports with an ESTABLISHED
status because these ports are still technically "up for grabs" (i.e. a new web server could be created on such a port). Only ports with a LISTEN
or LISTENING
(OS-dependent) status are considered "unavailable" or "hogged by a process". For the purposes of this tool, I want to (for now) keep the scope focused on answering "what's hogging a port I want to use?"
I did some cleanup around this idea and released it as v0.0.7
.
I see value in easily identifying which local processes are attempting to connect to a specific port, i.e. answer the question of "what process are connecting to my local API?". I'm not sure how many people would need that, but as a desktop developer, I can see the value of something like that. I don't know if that belongs in porthog or a separate tool. I'll have to think about that.
from porthog.
no worries, makes sense. For some reason, I thought I wouldn't be able to use any ports that already had an established connection. I tried it with a couple of ports to make sure that's not the case.
Thank you for the clarification.
from porthog.
Related Issues (1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from porthog.