Reputation: 791
I am using socket.io
in a NodeJS app. The socket.io
page is in localhost:8081/socket.io/
. However, I would like to have it in localhost:8081/hola/socket.io/
. Is that possible?
var express = require("express");
var app = express();
var server = require("http").Server(app);
var io = require("socket.io")(server);
//some code here...
server.listen(8081, function() {
console.log("Server running at http://localhost:8081/");
});
Upvotes: 1
Views: 58
Reputation: 6998
Just pass in path
in the options array which is the second option to socket.io
:
var io = require("socket.io")(server, { path: '/hola/socket.io'});
Upvotes: 1