Allow to specify port, and remove session id.

So now the way to address a node is in the form of:
`ip10_0_1_9-9200.play-with-docker.com`
This commit is contained in:
Jonathan Leibiusky @xetorthio
2016-11-18 09:54:12 -03:00
parent ec9d34ffda
commit 122118b9df
2 changed files with 8 additions and 5 deletions

3
api.go
View File

@@ -60,7 +60,8 @@ func main() {
r.Handle("/sessions/{sessionId}/ws/", server)
// Reverse proxy
r.Host(`{node}.{session}.play-with-docker.com`).Handler(handlers.NewMultipleHostReverseProxy())
r.Host(`{node}-{port:[0-9]*}.play-with-docker.com`).Handler(handlers.NewMultipleHostReverseProxy())
r.Host(`{node}.play-with-docker.com`).Handler(handlers.NewMultipleHostReverseProxy())
n := negroni.Classic()
n.UseHandler(r)