Skip to content

Commit c6e77d4

Browse files
author
mirko
committed
add Socat to README
1 parent 45f0e02 commit c6e77d4

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,19 @@ It is also possible to run multiple copies of this container with different port
8080
You can volume map your own text file to `/etc/motd` to override the message displayed upon connection.
8181
You can optionally set the docker argument `hostname`
8282

83+
## Socat Forwarding
84+
85+
This image includes `socat` which can be used to forward a local port to a remote address. This is disabled by default.
86+
To enable it, set `SOCAT_ENABLED=true` and configure the following variables:
87+
88+
| Variable | Default | Description |
89+
| :--- | :--- | :--- |
90+
| `SOCAT_ENABLED` | `false` | Set to `true` to enable the service. |
91+
| `SOCAT_LISTEN_PORT` | `43388` | The port to listen on within the container. |
92+
| `SOCAT_TARGET_HOST` | `localhost` | The target host to forward traffic to. |
93+
| `SOCAT_TARGET_PORT` | `43389` | The target port on the target host. |
94+
| `SOCAT_LOG_LEVEL` | `-ddd` | Socat log level (e.g., `-d`, `-dd`, `-ddd`). |
95+
8396
## Key Generation
8497

8598
This container has a helper script to generate an ssh private/public key. In order to generate a key please run:
@@ -120,6 +133,11 @@ services:
120133
- USER_PASSWORD_FILE=/path/to/file #optional
121134
- USER_NAME=linuxserver.io #optional
122135
- LOG_STDOUT= #optional
136+
- SOCAT_ENABLED=false #optional
137+
- SOCAT_LISTEN_PORT=43388 #optional
138+
- SOCAT_TARGET_HOST=localhost #optional
139+
- SOCAT_TARGET_PORT=43389 #optional
140+
- SOCAT_LOG_LEVEL=-ddd #optional
123141
volumes:
124142
- /path/to/openssh-server/config:/config
125143
ports:
@@ -146,6 +164,11 @@ docker run -d \
146164
-e USER_PASSWORD_FILE=/path/to/file `#optional` \
147165
-e USER_NAME=linuxserver.io `#optional` \
148166
-e LOG_STDOUT= `#optional` \
167+
-e SOCAT_ENABLED=false `#optional` \
168+
-e SOCAT_LISTEN_PORT=43388 `#optional` \
169+
-e SOCAT_TARGET_HOST=localhost `#optional` \
170+
-e SOCAT_TARGET_PORT=43389 `#optional` \
171+
-e SOCAT_LOG_LEVEL=-ddd `#optional` \
149172
-p 2222:2222 \
150173
-v /path/to/openssh-server/config:/config \
151174
--restart unless-stopped \
@@ -173,6 +196,11 @@ Containers are configured using parameters passed at runtime (such as those abov
173196
| `-e USER_PASSWORD_FILE=/path/to/file` | Optionally specify a file that contains the password. This setting supersedes the `USER_PASSWORD` option (works with docker secrets). |
174197
| `-e USER_NAME=linuxserver.io` | Optionally specify a user name (Default:`linuxserver.io`) |
175198
| `-e LOG_STDOUT=` | Set to `true` to log to stdout instead of file. |
199+
| `-e SOCAT_ENABLED=false` | Set to `true` to enable socat forwarding. |
200+
| `-e SOCAT_LISTEN_PORT=43388` | Port socat listens on inside the container. |
201+
| `-e SOCAT_TARGET_HOST=localhost` | Target host for socat forwarding. |
202+
| `-e SOCAT_TARGET_PORT=43389` | Target port for socat forwarding. |
203+
| `-e SOCAT_LOG_LEVEL=-ddd` | Socat log level. |
176204
| `-v /config` | Contains all relevant configuration files. |
177205

178206
## Environment variables from files (Docker secrets)

0 commit comments

Comments
 (0)