package ipcast import ( "fmt" "github.com/gin-gonic/gin" "lcfns/gatewayServer" "lcfns/service" "strings" ) type ApiGroup struct { IpcastApi } var ( ipcastService = service.ServiceGroupApp.IpcastServiceGroup.IpcastService ) func IpcastBaseUrl(c *gin.Context) string { header := c.GetHeader("isn") conn, ok := gatewayServer.ConnMap[header] fmt.Println("connmap:", gatewayServer.ConnMap) if !ok { return "" } return "http://" + strings.Split(conn.RemoteAddr().String(), ":")[0] + ":8849" }