Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #230 from antoniomika/am/sni-https
Added support for SNI proxying on HTTPS port
  • Loading branch information
antoniomika committed May 24, 2022
2 parents d6ca721 + 8eb708a commit 90f7b8f
Show file tree
Hide file tree
Showing 14 changed files with 333 additions and 101 deletions.
6 changes: 5 additions & 1 deletion .vscode/launch.json
Expand Up @@ -15,18 +15,22 @@
"args": [
"--debug=true",
"--http-address=:8081",
"--https-address=:8082",
"--ssh-address=:22222",
"--sni-proxy-https=true",
"--domain=testing.ssi.sh",
"--bind-random-subdomains=false",
"--bind-random-ports=false",
"--bind-random-aliases=false",
"--bind-any-host=true",
"--sni-proxy=true",
"--tcp-aliases=true",
"--https=false",
"--https=true",
"--authentication=false",
"--proxy-protocol=true",
"--proxy-protocol-listener=true",
"--proxy-protocol-use-timeout=true",
"--proxy-protocol-version=userdefined",
"--log-to-client=true",
"--admin-console=true",
"--service-console=true",
Expand Down
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -394,6 +394,7 @@ Flags:
-m, --service-console-token string The token to use for service console access. Auto generated if empty for each connected tunnel
--sni-load-balancer Enable the SNI load balancer (multiple clients can bind the same SNI domain/port)
--sni-proxy Enable the use of SNI proxying
--sni-proxy-https Enable the use of SNI proxying on the HTTPS port
-a, --ssh-address string The address to listen for SSH connections (default "localhost:2222")
--strip-http-path Strip the http path from the forward (default true)
--tcp-address string The address to listen for TCP connections
Expand Down
1 change: 1 addition & 0 deletions cmd/sish.go
Expand Up @@ -102,6 +102,7 @@ func init() {
rootCmd.PersistentFlags().BoolP("service-console", "", false, "Enable the service console for each service and send the info to connected clients")
rootCmd.PersistentFlags().BoolP("tcp-aliases", "", false, "Enable the use of TCP aliasing")
rootCmd.PersistentFlags().BoolP("sni-proxy", "", false, "Enable the use of SNI proxying")
rootCmd.PersistentFlags().BoolP("sni-proxy-https", "", false, "Enable the use of SNI proxying on the HTTPS port")
rootCmd.PersistentFlags().BoolP("log-to-client", "", false, "Enable logging HTTP and TCP requests to the client")
rootCmd.PersistentFlags().BoolP("idle-connection", "", true, "Enable connection idle timeouts for reads and writes")
rootCmd.PersistentFlags().BoolP("http-load-balancer", "", false, "Enable the HTTP load balancer (multiple clients can bind the same domain)")
Expand Down
1 change: 1 addition & 0 deletions config.example.yml
Expand Up @@ -76,6 +76,7 @@ service-console: false
service-console-token: ""
sni-load-balancer: false
sni-proxy: false
sni-proxy-https: false
ssh-address: localhost:2222
strip-http-path: true
tcp-address: ""
Expand Down
32 changes: 17 additions & 15 deletions go.mod
Expand Up @@ -5,20 +5,20 @@ go 1.18
require (
github.com/ScaleFT/sshkeys v0.0.0-20200327173127-6142f742bca5
github.com/antoniomika/syncmap v1.0.0
github.com/caddyserver/certmagic v0.15.4
github.com/fsnotify/fsnotify v1.5.1
github.com/caddyserver/certmagic v0.16.1
github.com/fsnotify/fsnotify v1.5.4
github.com/gin-gonic/gin v1.7.7
github.com/gorilla/websocket v1.5.0
github.com/jpillora/ipfilter v1.2.4
github.com/jpillora/ipfilter v1.2.5
github.com/logrusorgru/aurora v2.0.3+incompatible
github.com/mikesmitty/edkey v0.0.0-20170222072505-3356ea4e686a
github.com/pires/go-proxyproto v0.6.2
github.com/radovskyb/watcher v1.0.7
github.com/sirupsen/logrus v1.8.1
github.com/spf13/cobra v1.4.0
github.com/spf13/viper v1.10.1
github.com/vulcand/oxy v1.3.0
golang.org/x/crypto v0.0.0-20220321153916-2c7772ba3064
github.com/spf13/viper v1.11.0
github.com/vulcand/oxy v1.4.1
golang.org/x/crypto v0.0.0-20220518034528-6f7dac969898
gopkg.in/natefinch/lumberjack.v2 v2.0.0
)

Expand All @@ -28,7 +28,7 @@ require (
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-playground/locales v0.14.0 // indirect
github.com/go-playground/universal-translator v0.18.0 // indirect
github.com/go-playground/validator/v10 v10.10.1 // indirect
github.com/go-playground/validator/v10 v10.11.0 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
Expand All @@ -40,15 +40,16 @@ require (
github.com/mailgun/timetools v0.0.0-20170619190023-f3a7b8ffff47 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mholt/acmez v1.0.2 // indirect
github.com/miekg/dns v1.1.47 // indirect
github.com/mitchellh/mapstructure v1.4.3 // indirect
github.com/miekg/dns v1.1.49 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pelletier/go-toml v1.9.4 // indirect
github.com/phuslu/iploc v1.0.20220228 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.1 // indirect
github.com/phuslu/iploc v1.0.20220429 // indirect
github.com/segmentio/fasthash v1.0.3 // indirect
github.com/spf13/afero v1.8.2 // indirect
github.com/spf13/cast v1.4.1 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.2.0 // indirect
Expand All @@ -58,15 +59,16 @@ require (
go.uber.org/multierr v1.8.0 // indirect
go.uber.org/zap v1.21.0 // indirect
golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 // indirect
golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect
golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8 // indirect
golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 // indirect
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/tools v0.1.10 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df // indirect
google.golang.org/protobuf v1.28.0 // indirect
gopkg.in/ini.v1 v1.66.4 // indirect
gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0 // indirect
)

replace github.com/vulcand/oxy => github.com/antoniomika/oxy v1.1.1-0.20210804032133-5924ea01c950

0 comments on commit 90f7b8f

Please sign in to comment.