lejp-conf: add timeout-secs
This commit is contained in:
parent
714f66f5b7
commit
58a26ebf45
3 changed files with 13 additions and 1 deletions
|
@ -90,6 +90,9 @@ if a keyword is found in the user agent
|
|||
}]
|
||||
```
|
||||
|
||||
- `timeout-secs` lets you set the global timeout for various network-related
|
||||
operations in lws, in seconds. It defaults to 5.
|
||||
|
||||
@section lwswsv Lwsws Vhosts
|
||||
|
||||
One server can run many vhosts, where SSL is in use SNI is used to match
|
||||
|
|
|
@ -88,7 +88,10 @@ Other Global Options</h1>
|
|||
<ul>
|
||||
<li><code>reject-service-keywords</code> allows you to return an HTTP error code and message of your choice if a keyword is found in the user agent</li>
|
||||
</ul>
|
||||
<div class="fragment"><div class="line">"reject-service-keywords": [{</div><div class="line"> "scumbot": "404 Not Found"</div><div class="line">}]</div></div><!-- fragment --><h1><a class="anchor" id="lwswsv"></a>
|
||||
<div class="fragment"><div class="line">"reject-service-keywords": [{</div><div class="line"> "scumbot": "404 Not Found"</div><div class="line">}]</div></div><!-- fragment --><ul>
|
||||
<li><code>timeout-secs</code> lets you set the global timeout for various network-related operations in lws, in seconds. It defaults to 5.</li>
|
||||
</ul>
|
||||
<h1><a class="anchor" id="lwswsv"></a>
|
||||
Lwsws Vhosts</h1>
|
||||
<p>One server can run many vhosts, where SSL is in use SNI is used to match the connection to a vhost and its vhost-specific SSL keys during SSL negotiation.</p>
|
||||
<p>Listing multiple vhosts looks something like this </p><div class="fragment"><div class="line">{</div><div class="line"> "vhosts": [ {</div><div class="line"> "name": "localhost",</div><div class="line"> "port": "443",</div><div class="line"> "host-ssl-key": "/etc/pki/tls/private/libwebsockets.org.key",</div><div class="line"> "host-ssl-cert": "/etc/pki/tls/certs/libwebsockets.org.crt",</div><div class="line"> "host-ssl-ca": "/etc/pki/tls/certs/libwebsockets.org.cer",</div><div class="line"> "mounts": [{</div><div class="line"> "mountpoint": "/",</div><div class="line"> "origin": "file:///var/www/libwebsockets.org",</div><div class="line"> "default": "index.html"</div><div class="line"> }, {</div><div class="line"> "mountpoint": "/testserver",</div><div class="line"> "origin": "file:///usr/local/share/libwebsockets-test-server",</div><div class="line"> "default": "test.html"</div><div class="line"> }],</div><div class="line"> # which protocols are enabled for this vhost, and optional</div><div class="line"> # vhost-specific config options for the protocol</div><div class="line"> #</div><div class="line"> "ws-protocols": [{</div><div class="line"> "warmcat,timezoom": {</div><div class="line"> "status": "ok"</div><div class="line"> }</div><div class="line"> }]</div><div class="line"> },</div><div class="line"> {</div><div class="line"> "name": "localhost",</div><div class="line"> "port": "7681",</div><div class="line"> "host-ssl-key": "/etc/pki/tls/private/libwebsockets.org.key",</div><div class="line"> "host-ssl-cert": "/etc/pki/tls/certs/libwebsockets.org.crt",</div><div class="line"> "host-ssl-ca": "/etc/pki/tls/certs/libwebsockets.org.cer",</div><div class="line"> "mounts": [{</div><div class="line"> "mountpoint": "/",</div><div class="line"> "origin": ">https://localhost"</div><div class="line"> }]</div><div class="line"> },</div><div class="line"> {</div><div class="line"> "name": "localhost",</div><div class="line"> "port": "80",</div><div class="line"> "mounts": [{</div><div class="line"> "mountpoint": "/",</div><div class="line"> "origin": ">https://localhost"</div><div class="line"> }]</div><div class="line"> }</div><div class="line"></div><div class="line"> ]</div><div class="line">}</div></div><!-- fragment --><p>That sets up three vhosts all called "localhost" on ports 443 and 7681 with SSL, and port 80 without SSL but with a forced redirect to <a href="https://localhost">https://localhost</a></p>
|
||||
|
|
|
@ -37,6 +37,7 @@ static const char * const paths_global[] = {
|
|||
"global.server-string",
|
||||
"global.plugin-dir",
|
||||
"global.ws-pingpong-secs",
|
||||
"global.timeout-secs",
|
||||
"global.reject-service-keywords[].*",
|
||||
"global.reject-service-keywords[]",
|
||||
};
|
||||
|
@ -49,6 +50,7 @@ enum lejp_global_paths {
|
|||
LEJPGP_SERVER_STRING,
|
||||
LEJPGP_PLUGIN_DIR,
|
||||
LWJPGP_PINGPONG_SECS,
|
||||
LWJPGP_TIMEOUT_SECS,
|
||||
LWJPGP_REJECT_SERVICE_KEYWORDS_NAME,
|
||||
LWJPGP_REJECT_SERVICE_KEYWORDS
|
||||
};
|
||||
|
@ -269,6 +271,10 @@ lejp_globals_cb(struct lejp_ctx *ctx, char reason)
|
|||
a->info->ws_ping_pong_interval = atoi(ctx->buf);
|
||||
return 0;
|
||||
|
||||
case LWJPGP_TIMEOUT_SECS:
|
||||
a->info->timeout_secs = atoi(ctx->buf);
|
||||
return 0;
|
||||
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue