1
0
mirror of https://github.com/fumiama/terasu-cloudflared.git synced 2026-06-08 03:55:11 +08:00

AUTH-2394 added socks5 proxy

This commit is contained in:
Dalton
2020-03-31 09:56:22 -05:00
parent 710f66b0bb
commit a37da2b165
54 changed files with 2509 additions and 593 deletions

View File

@@ -44,6 +44,9 @@ func ssh(c *cli.Context) error {
Headers: headers,
}
// we could add a cmd line variable for this bool if we want the SOCK5 server to be on the client side
wsConn := carrier.NewWSConnection(logger, false)
if c.NArg() > 0 || c.IsSet(sshURLFlag) {
localForwarder, err := config.ValidateUrl(c)
if err != nil {
@@ -55,10 +58,12 @@ func ssh(c *cli.Context) error {
logger.WithError(err).Error("Error validating origin URL")
return errors.Wrap(err, "error validating origin URL")
}
return carrier.StartServer(logger, forwarder.Host, shutdownC, options)
logger.Infof("Start Websocket listener on: %s", forwarder.Host)
return carrier.StartForwarder(wsConn, forwarder.Host, shutdownC, options)
}
return carrier.StartClient(logger, &carrier.StdinoutStream{}, options)
return carrier.StartClient(wsConn, &carrier.StdinoutStream{}, options)
}
func buildRequestHeaders(values []string) http.Header {