Skip to content

Commit 03b8e24

Browse files
committed
Update README.md
1 parent 3393363 commit 03b8e24

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

README.md

+9-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ import "github.com/sgreben/sshtunnel"
1111
- [Get it](#get-it)
1212
- [Use it](#use-it)
1313
- [Docs](#docs)
14-
- [Example](#example)
14+
- [Toy example](#toy-example)
15+
- [Bigger example](#bigger-example)
1516
- [Limitations](#limitations)
1617

1718
## Get it
@@ -26,7 +27,7 @@ go get -u "github.com/sgreben/sshtunnel"
2627

2728
[![](https://godoc.org/github.com/sgreben/sshtunnel?status.svg)](http://godoc.org/github.com/sgreben/sshtunnel)
2829

29-
### Example
30+
### Toy example
3031

3132
```go
3233
package main
@@ -40,6 +41,7 @@ import (
4041
)
4142

4243
func main() {
44+
// Connect to "google.com:80" via a tunnel to "ubuntu@my-ssh-server-host:22"
4345
keyPath := "private-key.pem"
4446
tunnelConfig := sshtunnel.Config{
4547
SSHAddr: "my-ssh-server-host:22",
@@ -48,17 +50,20 @@ func main() {
4850
Keys: []sshtunnel.ConfigAuthKey{{Path: &keyPath}},
4951
},
5052
}
51-
// connect to "google.com:80" via a tunnel to "ubuntu@my-ssh-server-host:22"
5253
conn, _, err := sshtunnel.Dial("tcp", "google.com:80", &tunnelConfig)
5354
if err != nil {
5455
panic(err)
5556
}
56-
// do things with conn
57+
// Do things with conn
5758
fmt.Fprintln(conn, "GET /")
5859
io.Copy(os.Stdout, conn)
5960
}
6061
```
6162

63+
### Bigger example
64+
65+
See [docker-compose-hosts](https://github.com/sgreben/docker-compose-hosts).
66+
6267
## Limitations
6368

6469
- **Host key verification is disabled** when using the "simple config", and can only be configured when using a raw `ssh.ClientConfig`.

0 commit comments

Comments
 (0)