This commit is contained in:
parent
2e73689762
commit
4ab6f166b0
@ -93,19 +93,26 @@ func (s *Server) getInfo(w http.ResponseWriter, _ *http.Request) {
|
|||||||
}
|
}
|
||||||
s.mu.RUnlock()
|
s.mu.RUnlock()
|
||||||
|
|
||||||
|
fmt.Println(1)
|
||||||
|
|
||||||
// Create Response
|
// Create Response
|
||||||
d, err := json.MarshalIndent(InfoResponse{
|
d, err := json.MarshalIndent(InfoResponse{
|
||||||
Tunnels: allTunnels,
|
Tunnels: allTunnels,
|
||||||
Version: config.GetVersion(),
|
Version: config.GetVersion(),
|
||||||
}, "", " ")
|
}, "", " ")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
fmt.Println(4)
|
||||||
|
log.WithError(err).Error("failed to marshal info")
|
||||||
w.WriteHeader(http.StatusInternalServerError)
|
w.WriteHeader(http.StatusInternalServerError)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fmt.Println(2, string(d))
|
||||||
|
|
||||||
// Send Response
|
// Send Response
|
||||||
w.Header().Set("Content-Type", "application/json")
|
w.Header().Set("Content-Type", "application/json")
|
||||||
_, _ = w.Write(d)
|
_, _ = w.Write(d)
|
||||||
|
fmt.Println(3)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Server) handleRawConnection(conn net.Conn) {
|
func (s *Server) handleRawConnection(conn net.Conn) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user