14 lines
No EOL
309 B
JavaScript
14 lines
No EOL
309 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();
|
|
socket.sendText('hello');
|
|
});
|
|
|
|
httpServer.listen(8080); |