const http = require('http'); const Wormhole = require('../index'); const httpServer = http.createServer(); const wormhole = new Wormhole({ urls: [ '/hello' ], httpServer }); wormhole.on('connect', ({ socket, accept, reject }) => { accept(); socket.sendText('hello'); }); httpServer.listen(8080);