Closed web-padawan closed 8 years ago
no, we don't currently support virtual hosts.. is that feature necessary for a local development server? Currently, ws
does not pay any attention to the hostname of the client request..
To begin with, please implement this feature in a separate module extending local-web-server.. if you have some success with the feature, and think all ws
users would benefit from it, we could later absorb it into local-web-server.. so, your extension would look something like this:
const app = localWebServer()
app.use(myVirtualHostMiddleware)
const server = http.createServer(serverOptions, app.callback())
server.listen(8000)
Thanks for explanation! I'll try it out.
Is there a way to implement virtual host config? For now, I simply add my host alias into
/etc/hosts
and it proxifies me to 127.0.0.1 But in my opinion it would be nice to be able to configure it.I looked for koa adapter and found two versions: koa-vhost and vhost-koa. Both are developed for older koa versions. I tried first of those, but it seems that I'm doing something wrong. The way I include it is like this: