You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This will run HTTP server on port `80` and HTTPS (HTTP/2) server on port `443`. If you want to use HTTPS it's recommended to get a properly signed certificate to avoid security warnings.
70
70
71
-
If both http and https are configured, an automatic redirect to the secure channel will be established using an `http.StatusMovedPermanently` (301)
72
-
73
71
### Run Server as a Service on Ubuntu using Systemd:
74
72
75
73
* After completing the steps above successfully, create a new file for your service (you can name it whatever you want, just replace the name below with your chosen name).
There are many more options for systemd services, and this is by not means an exhaustive configuration file.
131
129
132
-
## Configuration
130
+
## Configuration - Client
133
131
134
132
The tunnel client `tunnel` requires configuration file, by default it will try reading `tunnel.yml` in your current working directory. If you want to specify other file use `-config` flag.
135
133
@@ -176,10 +174,48 @@ Configuration options:
176
174
* `max_interval`: maximal time client would wait before redialing the server, *default:* `1m`
177
175
* `max_time`: maximal time client would try to reconnect to the server if connection was lost, set `0` to never stop trying, *default:* `15m`
178
176
177
+
## Configuration - Server
178
+
179
+
* `httpAddr`: Public address for HTTP connections, empty string to disable, *default:* `:80`
180
+
* `httpsAddr`: Public address listening for HTTPS connections, emptry string to disable, *default:* `:443`
181
+
* `tunnelAddr`: Public address listening for tunnel client, *default:* `:5223`
182
+
* `apiAddr`: Public address for HTTP API to get info about the tunnels, *default:* `:5091`
183
+
* `sniAddr`: Public address listening for TLS SNI connections, empty string to disable
184
+
* `tlsCrt`: Path to a TLS certificate file, *default:* `server.crt`
185
+
* `tlsKey`: Path to a TLS key file, *default:* `server.key`
186
+
* `rootCA`: Path to the trusted certificate chian used for client certificate authentication, if empty any client certificate is accepted
187
+
* `clients`: Comma-separated list of tunnel client ids, if empty accept all clients
188
+
* `logLevel`: Level of messages to log, 0-3, *default:* 1
189
+
190
+
If both `httpAddr` and `httpsAddr` are configured, an automatic redirect to the secure channel will be established using an `http.StatusMovedPermanently` (301)
191
+
179
192
### Custom error pages
180
193
181
194
Just copy the `html` folder from this repository into the folder of the tunnel-server to have a starting point. In the `html/errors` folder you'll find a sample page for each error that is currently customisable which you'll be able to change according to your needs.
182
195
196
+
## Status API
197
+
198
+
### /api/clients/list
199
+
200
+
Returns a list of `clients` together with a list of open tunnels in JSON format.
201
+
202
+
```json
203
+
[
204
+
{
205
+
"Id": "BHXWUUT-A6IYDWI-2BSIC5A-...",
206
+
"Listeners": [
207
+
{
208
+
"Network": "tcp",
209
+
"Addr": "192.0.2.1:25"
210
+
}
211
+
],
212
+
"Hosts": [
213
+
"hannes.asacloud.eu"
214
+
]
215
+
}
216
+
]
217
+
```
218
+
183
219
## How it works
184
220
185
221
A client opens TLS connection to a server. The server accepts connections from known clients only. The client is recognized by its TLS certificate ID. The server is publicly available and proxies incoming connections to the client. Then the connection is further proxied in the client's network.
0 commit comments