mirror of
https://github.com/xjasonlyu/tun2socks.git
synced 2024-12-30 02:37:01 +00:00
fix log output & remove auto refresh
This commit is contained in:
@@ -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
@@ -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
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user