-
Notifications
You must be signed in to change notification settings - Fork 249
EADDRINUSE on free port with wscat --listen #165
Copy link
Copy link
Open
Description
When running wscat --listen --port 8080, I get the following error:
error: listen EADDRINUSE: address already in use --port
However, the port is actually free — I confirmed this with:
sudo lsof -iTCP:8080 -sTCP:LISTEN
# (no output)
python -m http.server 8080 # works fineThis happens even after killing all node processes (pkill -9 node)
It seems that wscat is incorrectly detecting the port as in use.
Environment:
OS:
NAME="Fedora Linux"
VERSION="40 (Workstation Edition)"
ID=fedora
VERSION_ID=40
VERSION_CODENAME=""
PLATFORM_ID="platform:f40"
PRETTY_NAME="Fedora Linux 40 (Workstation Edition)"
ANSI_COLOR="0;38;2;60;110;180"
LOGO=fedora-logo-icon
CPE_NAME="cpe:/o:fedoraproject:fedora:40"
DEFAULT_HOSTNAME="fedora"
HOME_URL="https://fedoraproject.org/"
DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f40/system-administrators-guide/"
SUPPORT_URL="https://ask.fedoraproject.org/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=40
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=40
SUPPORT_END=2025-05-13
VARIANT="Workstation Edition"
VARIANT_ID=workstation
Node.js version: v24.3.0
wscat version: 6.1.0
Installed globally via npm
```
Notes:
This issue does not occur with Python’s http.server or other WebSocket servers on the same port.
Might be related to stale socket reuse or an IPv6/IPv4 binding conflict.
Workaround: using another tool like ws works fine.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels