enobufs / stun

STUN server using node.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error: bind EADDRINUSE $myIP:3342

hktalent opened this issue · comments

commented

@keyneom https://github.com/keyneom/stun

myIP="169.149.12.16"

# stunsrv $myIP $myIP 3342 5589 $myIP $myIP
Starting Server . . .
soc[0] listening on $myIP:3342
soc[1] listening on $myIP:5589
events.js:167
      throw er; // Unhandled 'error' event
      ^

Error: bind EADDRINUSE $myIP:3342
    at state.handle.lookup (dgram.js:242:18)
    at process._tickCallback (internal/process/next_tick.js:63:19)
    at Function.Module.runMain (internal/modules/cjs/loader.js:745:11)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)
Emitted 'error' event at:
    at state.handle.lookup (dgram.js:243:14)
    at process._tickCallback (internal/process/next_tick.js:63:19)
    [... lines matching original stack trace ...]
    at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)

It appears as if you are using a fork of this library that I made quite a long time ago and have opened an issue in the incorrect repository. I would recommend switching to the version of the code in this repo instead as it now can be installed as a node package anyways.

Regarding your error, you appear to be attempting to bind to the same ip address. You need two separate ip addresses in order for the stun server to work correctly, as indicated in the readme. Best of luck!