|
|
@ -1,5 +1,4 @@ |
|
|
|
sclient.go |
|
|
|
========== |
|
|
|
# sclient |
|
|
|
|
|
|
|
Secure Client for exposing TLS (aka SSL) secured services as plain-text connections locally. |
|
|
|
|
|
|
@ -8,81 +7,75 @@ Also ideal for multiplexing a single port with multiple protocols using SNI. |
|
|
|
Unwrap a TLS connection: |
|
|
|
|
|
|
|
```bash |
|
|
|
$ sclient whatever.com:443 localhost:3000 |
|
|
|
sclient whatever.com:443 localhost:3000 |
|
|
|
|
|
|
|
> [listening] whatever.com:443 <= localhost:3000 |
|
|
|
``` |
|
|
|
|
|
|
|
Connect via Telnet |
|
|
|
|
|
|
|
```bash |
|
|
|
$ telnet localhost 3000 |
|
|
|
telnet localhost 3000 |
|
|
|
``` |
|
|
|
|
|
|
|
Connect via netcat (nc) |
|
|
|
|
|
|
|
```bash |
|
|
|
$ nc localhost 3000 |
|
|
|
nc localhost 3000 |
|
|
|
``` |
|
|
|
|
|
|
|
cURL |
|
|
|
|
|
|
|
```bash |
|
|
|
$ curl http://localhost:3000 -H 'Host: whatever.com' |
|
|
|
curl http://localhost:3000 -H 'Host: whatever.com' |
|
|
|
``` |
|
|
|
|
|
|
|
A poor man's (or Windows user's) makeshift replacement for `openssl s_client`, `stunnel`, or `socat`. |
|
|
|
|
|
|
|
Install |
|
|
|
======= |
|
|
|
|
|
|
|
### Downloads |
|
|
|
# Table of Contents |
|
|
|
|
|
|
|
* [Windows 10](https://telebit.cloud/sclient/dist/windows/amd64/sclient.exe) |
|
|
|
* [Mac OS X](https://telebit.cloud/sclient/dist/darwin/amd64/sclient) |
|
|
|
* [Linux (x64)](https://telebit.cloud/sclient/dist/linux/amd64/sclient) |
|
|
|
* [Raspberry Pi (armv7)](https://telebit.cloud/sclient/dist/linux/armv7/sclient) |
|
|
|
* more downloads <https://telebit.cloud/sclient/> |
|
|
|
- [Install](#install) |
|
|
|
- [Usage](#usage) |
|
|
|
- [Examples](#examples) |
|
|
|
- [Build from Source](#build-from-source) |
|
|
|
|
|
|
|
### Build from source |
|
|
|
# Install |
|
|
|
|
|
|
|
For the moment you'll have to install go and compile `sclient` yourself: |
|
|
|
|
|
|
|
* <https://golang.org/doc/install#install> |
|
|
|
### Mac, Linux |
|
|
|
|
|
|
|
```bash |
|
|
|
git clone https://git.rootprojects.org/root/sclient.go.git |
|
|
|
pushd sclient.go |
|
|
|
go build -o dist/sclient cmd/sclient/main.go |
|
|
|
rsync -av dist/sclient /usr/local/bin/sclient |
|
|
|
sclient example.com:443 localhost:3000 |
|
|
|
curl -sS https://webinstall.dev/sclient | bash |
|
|
|
``` |
|
|
|
|
|
|
|
Or |
|
|
|
|
|
|
|
```bash |
|
|
|
go get git.rootprojects.org/root/sclient.go/cmd/sclient |
|
|
|
go run git.rootprojects.org/root/sclient.go/cmd/sclient example.com:443 localhost:3000 |
|
|
|
curl.exe -A MS https://webinstall.dev/sclient | powershell |
|
|
|
``` |
|
|
|
|
|
|
|
Usage |
|
|
|
===== |
|
|
|
### Downloads |
|
|
|
|
|
|
|
Check the [Github Releases](https://github.com/therootcompany/sclient/releases) for |
|
|
|
|
|
|
|
- macOS (x64) Apple Silicon [coming soon](https://github.com/golang/go/issues/39782) |
|
|
|
- Linux (x64, i386, arm64, arm6, arm7) |
|
|
|
- Windows 10 (x64, i386) |
|
|
|
|
|
|
|
# Usage |
|
|
|
|
|
|
|
```bash |
|
|
|
sclient [flags] <remote> <local> |
|
|
|
``` |
|
|
|
|
|
|
|
* flags |
|
|
|
* -k, --insecure ignore invalid TLS (SSL/HTTPS) certificates |
|
|
|
* --servername <string> spoof SNI (to disable use IP as <remote> and do not use this option) |
|
|
|
* remote |
|
|
|
* must have servername (i.e. example.com) |
|
|
|
* port is optional (default is 443) |
|
|
|
* local |
|
|
|
* address is optional (default is localhost) |
|
|
|
* must have port (i.e. 3000) |
|
|
|
- flags |
|
|
|
- -k, --insecure ignore invalid TLS (SSL/HTTPS) certificates |
|
|
|
- --servername <string> spoof SNI (to disable use IP as <remote> and do not use this option) |
|
|
|
- remote |
|
|
|
- must have servername (i.e. example.com) |
|
|
|
- port is optional (default is 443) |
|
|
|
- local |
|
|
|
- address is optional (default is localhost) |
|
|
|
- must have port (i.e. 3000) |
|
|
|
|
|
|
|
Examples |
|
|
|
======== |
|
|
|
# Examples |
|
|
|
|
|
|
|
Bridge between `telebit.cloud` and local port `3000`. |
|
|
|
|
|
|
@ -127,3 +120,32 @@ sclient --servername "Robert'); DROP TABLE Students;" -k example.com localhost:3 |
|
|
|
```bash |
|
|
|
sclient --servername "../../../.hidden/private.txt" -k example.com localhost:3000 |
|
|
|
``` |
|
|
|
|
|
|
|
# Build from source |
|
|
|
|
|
|
|
You'll need to install [Go](https://golang.org). |
|
|
|
See [webinstall.dev/golang](https://webinstall.dev/golang) for install instructions. |
|
|
|
|
|
|
|
```bash |
|
|
|
curl -sS https://webinstall.dev/golang | bash |
|
|
|
``` |
|
|
|
|
|
|
|
Then you can install and run as per usual. |
|
|
|
|
|
|
|
```bash |
|
|
|
git clone https://git.rootprojects.org/root/sclient.go.git |
|
|
|
|
|
|
|
pushd sclient.go |
|
|
|
go build -o dist/sclient cmd/sclient/main.go |
|
|
|
sudo rsync -av dist/sclient /usr/local/bin/sclient |
|
|
|
popd |
|
|
|
|
|
|
|
sclient example.com:443 localhost:3000 |
|
|
|
``` |
|
|
|
|
|
|
|
## Install or Run with Go |
|
|
|
|
|
|
|
```bash |
|
|
|
go get git.rootprojects.org/root/sclient.go/cmd/sclient |
|
|
|
go run git.rootprojects.org/root/sclient.go/cmd/sclient example.com:443 localhost:3000 |
|
|
|
``` |
|
|
|