wormhole/example/example.js

13 lines
No EOL
279 B
JavaScript

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();
});
httpServer.listen(8080);