UNPKG

webssh2-server

Version:

A Websocket to SSH2 gateway using xterm.js, socket.io, ssh2

16 lines (15 loc) 508 B
import http from 'node:http'; import debug from 'debug'; const serverDebug = debug('webssh:server'); export function createServer(app) { return http.createServer(app); } function handleServerError(err) { console.error('HTTP Server ERROR: %O', err); } export function startServer(server, config) { server.listen(config.listen.port, config.listen.ip, () => { serverDebug(`Server listening on ${config.listen.ip}:${config.listen.port}`); }); server.on('error', handleServerError); }