M
M
Maxim Pavlov2017-10-01 14:40:45
JavaScript
Maxim Pavlov, 2017-10-01 14:40:45

Why does socket.io server crash during socket.emit on client side?

My node.js socket server crashes with this error
C:\Users\M4k5y\source\repos\chatik\chatik\node_modules\socket.io\lib\socket.js:514
emit.apply(self, event); TypeError: CreateListFromArrayLike called on non-object
at C:\Users\M4k5y\source\repos\chatik\chatik\node_modules\socket.io\lib\socket.js:514:12
at _combinedTickCallback (internal/process/next_tick.js: 73:7)
at process._tickCallback (internal/process/next_tick.js:104:9)

Here is the js code from the browser

var socket = io('http://localhost:80');
socket.emit('lol', "hello");

Sample server code
var io1 = require('socket.io')(80);
io1.on('lol', function (data) { console.log(data) });

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Pavlov, 2017-10-02
@liberaven

This is a vulnerability. I dropped other people's servers :\

A
Abcdefgk, 2017-10-01
@Abcdefgk

First, there should probably be a connect event on the server, which creates a socket object (with a unique ID, etc.)
And this ... port 80, why? To not miss?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question