enter.go 506 B

123456789101112131415161718192021222324252627
  1. package ipcast
  2. import (
  3. "fmt"
  4. "github.com/gin-gonic/gin"
  5. "lcfns/gatewayServer"
  6. "lcfns/service"
  7. "strings"
  8. )
  9. type ApiGroup struct {
  10. IpcastApi
  11. }
  12. var (
  13. ipcastService = service.ServiceGroupApp.IpcastServiceGroup.IpcastService
  14. )
  15. func IpcastBaseUrl(c *gin.Context) string {
  16. header := c.GetHeader("isn")
  17. conn, ok := gatewayServer.ConnMap[header]
  18. fmt.Println("connmap:", gatewayServer.ConnMap)
  19. if !ok {
  20. return ""
  21. }
  22. return "http://" + strings.Split(conn.RemoteAddr().String(), ":")[0] + ":8849"
  23. }