fix log output & remove auto refresh

This commit is contained in:
Jason
2019-08-14 19:27:25 +08:00
parent b2fc35198a
commit fca6ef5ac4
3 changed files with 4 additions and 8 deletions
+2 -6
View File
@@ -80,17 +80,13 @@ func (s *simpleSessionStater) sessionStatsHandler(resp http.ResponseWriter, req
w := bufio.NewWriter(resp)
_, _ = fmt.Fprintf(w, "<html>")
_, _ = fmt.Fprintf(w, `<head>
<style>
_, _ = fmt.Fprintf(w, `<head><style>
table, th, td {
border: 1px solid black;
border-collapse: collapse;
text-align: right;
padding: 4;
}</style>
<title>Go-tun2socks Sessions</title>
<meta http-equiv="refresh" content="1" >
</head>`)
}</style><title>Go-tun2socks Sessions</title></head>`)
_, _ = fmt.Fprintf(w, "<h2>Go-tun2socks %s</h2>", StatsVersion)
_, _ = fmt.Fprintf(w, "<h3>Now: %s ; Uptime: %s</h3>", now(), uptime())
_, _ = fmt.Fprintf(w, "<p>Active sessions %d</p>", len(activeSessions))
+1 -1
View File
@@ -97,7 +97,7 @@ func (h *tcpHandler) Handle(conn net.Conn, target *net.TCPAddr) error {
// Dial
remoteConn, err := dial(proxyAddr, targetAddr)
if err != nil {
log.Warnf("Dial %v error: %v", proxyAddr, err)
log.Infof("Dial %v: %v", proxyAddr, err)
return err
}
+1 -1
View File
@@ -75,7 +75,7 @@ func (h *udpHandler) Connect(conn core.UDPConn, target *net.UDPAddr) error {
// Dial
remoteConn, remoteAddr, err := dialUDP(proxyAddr, targetAddr)
if err != nil {
log.Warnf("DialUDP %v error: %v", proxyAddr, err)
log.Infof("DialUDP %v: %v", proxyAddr, err)
return err
}