Skip to content

Commit

Permalink
prepare for v0.0.16
Browse files Browse the repository at this point in the history
  • Loading branch information
p4gefau1t committed Apr 3, 2020
1 parent 65935b0 commit db3024c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion daemon/deamon.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func (o *DaemonOption) Handle() error {
}
cmd := exec.Command(os.Args[0], args...)
cmd.Start()
fmt.Println("Trojan-Go is running in the background")
fmt.Println("Trojan-Go is running in the background...")
fmt.Println("[PID]", cmd.Process.Pid)
os.Exit(0)
return nil
Expand Down
2 changes: 2 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import (
"github.com/p4gefau1t/trojan-go/common"
"github.com/p4gefau1t/trojan-go/log"

//the following modules are optional
//you can comment some of them if you don't need them
_ "github.com/go-sql-driver/mysql"
_ "github.com/p4gefau1t/trojan-go/cert"
_ "github.com/p4gefau1t/trojan-go/daemon"
Expand Down
4 changes: 2 additions & 2 deletions proxy/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func (c *Client) listenUDP() {
})
if err != nil {
logger.Error(common.NewError("failed to listen udp").Base(err))
time.Sleep(time.Second * 5)
time.Sleep(protocol.UDPTimeout)
continue
}
inbound, err := socks.NewInboundPacketSession(listener)
Expand All @@ -75,7 +75,7 @@ func (c *Client) listenUDP() {
logger.Debug("keep alive..(alive)")
case <-c.associatedChan:
logger.Debug("keep alive..(associated)")
case <-time.After(protocol.UDPTimeout):
case <-time.After(protocol.UDPTimeout * 5):
logger.Debug("time out, closing UDP tunnel")
outbound.Close()
inbound.Close()
Expand Down
4 changes: 2 additions & 2 deletions proxy/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,15 @@ func (s *Server) handleConn(conn net.Conn) {
func (s *Server) handleInvalidConn(conn net.Conn, tlsConn *tls.Conn) {
defer conn.Close()
if len(s.config.TLS.HTTPResponse) > 0 {
logger.Warn("trying to response a plain http response")
logger.Warn("trying to response with a plain http response")
conn.Write(s.config.TLS.HTTPResponse)
return
}

if s.config.TLS.FallbackAddr != nil {
defer func() {
if r := recover(); r != nil {
logger.Error("Recovered", r)
logger.Error("recovered", r)
}
}()
//HACK
Expand Down

0 comments on commit db3024c

Please sign in to comment.