Skip to content

Using socket.io in the dev-server? #76

@ArnoBuschmann

Description

@ArnoBuschmann

I wanted to use socket.io in my project, so I added this to the express server.js file:

/**
 * Initialize socket.io
 */
var http = require('http').Server(app);
var io = require('socket.io')(http);
io.on('connection', function(socket){
        console.log('neue Socket-Connection');
        socket.on('event', function(data){});
        socket.on('disconnect', function(){});
});

Now when creating a production build, the socket communication between client and server works nicely as expected.

But: Unfortunately it is not working when running the Webpack dev server :(

Has anyone an idea how that could be fixed?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions