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
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. 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 take
  8. advantage of the features of 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. Package Basics
  12. In the simplest case you'll just be setting a ServerName and connection info:
  13. servername := "example.com"
  14. sclient := &sclient.Tunnel{
  15. ServerName: servername,
  16. RemoteAddress: servername,
  17. RemotePort: 443,
  18. LocalAddress: "localhost",
  19. LocalPort: 3000,
  20. }
  21. err := sclient.DialAndListen()
  22. Try the CLI
  23. If you'd like to better understand what sclient does, you can try it out with `go run`:
  24. go get git.rootprojects.org/root/sclient.go/cmd/sclient
  25. go run git.rootprojects.org/root/sclient.go/cmd/sclient example.com:443 localhost:3000
  26. curl http://localhost:3000 -H "Host: example.com"
  27. Pre-built versions for various platforms are also available at
  28. https://telebit.cloud/sclient
  29. */
  30. package sclient