Hapi 8 has introduced some new intricacies so if anyone if revisiting this issue...
On the client, you don't have to use /socket.io/socket.io.js
, instead use
https://cdnjs.cloudflare.com/ajax/libs/socket.io/0.9.16/socket.io.min.js
)http://yoursite.io/js/socket.io/socket.io.js
)Better yet, use something like npm/browserify and (https://www.npmjs.com/package/socket.io-client):
var socket = require('socket.io-client')('http://localhost:8080');
Which ever way you choose to include the client side code above
Hapi 8 will allow you to do something cool on your server with chat like this:
server.js
server.connection({ port: 8000, labels: 'app' });
server.connection({ port: 8080, labels: 'chat' });
server.register({
register: require('./server/plugins/socketIO')
},
function(err) {
if (err) throw err;
});
/plugins/socketIO/index.js
exports.register = function(server, options, next) {
var io = require('socket.io').listen(server.select('chat').listener,{log:false});
io.sockets.on('connection', function (socket) {
socket.on('someAction', function(name, cb) {
...
});
...
});
}
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4