kirm / sip.js

Session Initiation Protocol for node.js
MIT License
427 stars 171 forks source link

socket.address is not a function #129

Open cracker0dks opened 6 years ago

cracker0dks commented 6 years ago

Hey, I'm testing the basic examples from example folder and get this on every connection I try:

/home/test/node_modules/sip/sip.js:626
local = {address: ws._socket.address().address, port: ws._socket.address().port},
                            ^
TypeError: ws._socket.address is not a function

if I console log ws._socket ill get:

{ remotePort: 56322,
  remoteAddress: '::ffff:192.168.0.5',
  remoteFamily: 'IPv6' }

Why is their no address function? Do I miss something?

Node Version: 8.11.1 OS: Debian 9

latysheff commented 6 years ago

As a temporary solution try to change web sockets module in sip.js from 'uws' back to 'ws': var WebSocket = require('ws');

cracker0dks commented 6 years ago

yep, no error anymore! Thanks :)