Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add info endpoint to discover create ports
  • Loading branch information
matteosuppo committed Sep 28, 2015
commit 280c7682b88fea8471755bb9c6bfaf05205abecc
14 changes: 14 additions & 0 deletions info.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package main

import (
"github.com/gin-gonic/gin"
)

func infoHandler(c *gin.Context) {
c.JSON(200, gin.H{
"http": "http://localhost" + port,
"https": "https://localhost" + port,
"ws": "ws://localhost" + port,
"wss": "wss://localhost" + portSSL,
})
}
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ func main() {
r.POST("/socket.io/", socketHandler)
r.Handle("WS", "/socket.io/", socketHandler)
r.Handle("WSS", "/socket.io/", socketHandler)
r.GET("/info", infoHandler)
go func() {
start := 49152
end := 65535
Expand Down