Secure Client for exposing TLS (aka SSL) secured services as plain-text connections locally, and for multiplexing a single port with multiple protocols using SNI
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

doc.go 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. Package sclient unwraps SSL.
  3. It makes secure remote connections (such as HTTPS) available locally as plain-text connections -
  4. similar to `stunnel` or `openssl s_client`.
  5. There are a variety of reasons that you might want to do that,
  6. but we created it specifically to be able to upgrade applications with legacy
  7. security protocols - like SSH, OpenVPN, and Postgres - to be able to take
  8. advantage of the features modern TLS, such as ALPN and SNI
  9. (which makes them routable through almost every type of firewall).
  10. See https://telebit.cloud/sclient for more info.
  11. Try the CLI
  12. go get git.rootprojects.org/root/sclient.go/cmd/sclient
  13. go run git.rootprojects.org/root/sclient.go/cmd/sclient example.com:443 localhost:3000
  14. Package Basics
  15. servername := "example.com"
  16. sclient := &sclient.Tunnel{
  17. ServerName: servername,
  18. RemoteAddress: servername,
  19. RemotePort: 443,
  20. LocalAddress: "localhost",
  21. LocalPort: 3000,
  22. }
  23. err := sclient.DialAndListen()
  24. Pre-built versions for various platforms are also available at
  25. https://telebit.cloud/sclient
  26. */
  27. package sclient