console.log(err)
})
console.log(`HTTP${(conf.tls == undefined) ? '' : 'S'} ` +
- `Server Started on port ${conf.port}${this.httpdRoot ?
+ `Server Started on port ${conf.port}${this.httpdRoot ?
`, serving files from ${this.httpdRoot}`:''}`)
},
let htArgv = request.url.slice(1).split('?')
const routeName = htArgv[0].split('/')[0]
let route = this.routes[routeName]
- console.log(`route is ${route}`)
/* If the route exists, check if we are a returning host or a new client */
if (route) {
if (route.bind) {
// that isn't just "give you a route if it's available" on visit
/* else if (route.origin == (request.headers['x-forwarded-for'] ||
request.connection.remoteAddress))
- this.serveHost(response, route, htArgv)
- else */
- else {
+ this.serveHost(response, route, htArgv) */
+ else
this.serveClient(request, response, route)
- }
}
/* If it's a valid routename that doesn't exist, make this client a host */
else if (this.validRoutes.test(routeName)) {
this.serveHost(response, route, argv)
},
- /** @func
+ /** @Func
* @summary Serve a route to an authorized http host
* @desc services host application to the client, establishing a socket
* @arg {http.ServerResponse} response - response object to use