diff --git a/server/server.go b/server/server.go index a88e63e..5ddbdf3 100644 --- a/server/server.go +++ b/server/server.go @@ -10,6 +10,8 @@ import ( "net/http/httputil" "net/url" + "crypto/tls" + "github.com/gin-gonic/gin" "github.com/gorilla/websocket" "github.com/juju/loggo" @@ -113,5 +115,21 @@ func (server *WebSocksServer) Run() (err error) { } return } + + s.TLSConfig = &tls.Config{ + CipherSuites: []uint16{ + tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, + tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, + tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, + tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, + tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, + tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, + }, + } + + err = s.ListenAndServeTLS(server.Config.CertPath, server.Config.KeyPath) + if err != nil { + return err + } return } diff --git a/websocks.go b/websocks.go index fa652ba..a9598c3 100644 --- a/websocks.go +++ b/websocks.go @@ -90,9 +90,9 @@ func main() { }, }, { - Name: "server", - //Aliases: []string{"s"}, - Usage: "start websocks server", + Name: "server", + Aliases: []string{"s"}, + Usage: "start websocks server", Flags: []cli.Flag{ cli.StringFlag{ Name: "l", @@ -213,7 +213,7 @@ func main() { }, { Name: "webserver", - Aliases: []string{"s"}, + Aliases: []string{"w"}, Usage: "web ui server", Action: func(c *cli.Context) (err error) { app := &server.App{}