Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- initialize() {
- this.io = window.require('socket.io')();
- const options = { pingTimeout: 100000000000000000 };
- const http = window.require('http');
- const ip = '127.0.0.1';
- const httpServer = http.createServer();
- httpServer.listen(55555, ip);
- this.io.attach(httpServer, options);
- const namespace = this.io.of(`/blah`);
- namespace.on('connection', socket => {
- console.log('emit connect');
- socket.emit('connected');
- });
- }
- function openConnection(apiKey, amount, symbol, memo) {
- var socket = io.connect('127.0.0.1:55555/blah');
- socket.on('connected', () => {
- console.log('CONNECTED')
- });
- }
Add Comment
Please, Sign In to add comment