enter.go 451 B

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