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
Copy file name to clipboardExpand all lines: README.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -550,7 +550,7 @@ Once a webserver is created, you can manage its execution through the following
550
550
* _**bool** webserver::run_wait(**int32_t** millisec):_ Run the webserver's event loop, blocking until there is activity or the timeout expires. Pass `-1` for indefinite wait. Returns `true` on success.
551
551
* _**bool** webserver::get_fdset(**fd_set*** read_fd_set, **fd_set*** write_fd_set, **fd_set*** except_fd_set, **int*** max_fd):_ Get the file descriptor sets for `select()`-based external event loop integration. Returns `true` on success.
552
552
* _**bool** webserver::get_timeout(**uint64_t*** timeout):_ Get the timeout (in milliseconds) until the next daemon action is needed. Returns `true` if a timeout was set, `false` if no timeout is needed.
553
-
* _**bool** webserver::add_connection(**int** client_socket, **const struct sockaddr*** addr, **socklen_t** addrlen):_ Add an externally-accepted socket connection to the daemon. Useful with `no_listen_socket()`. Returns `true` on success.
553
+
* _**bool** webserver::add_connection(**int** client_socket, **const struct sockaddr*** addr, **socklen_t** addrlen):_ Add an externally-accepted socket connection to the daemon. Useful with `listen_socket(false)`. Returns `true` on success.
554
554
* _**int** webserver::get_listen_fd():_ Get the listen socket file descriptor, or `-1` if not available.
555
555
* _**unsigned int** webserver::get_active_connections():_ Get the number of currently active connections.
556
556
* _**uint16_t** webserver::get_bound_port():_ Get the actual port the daemon is bound to. Particularly useful when port `0` was specified to let the OS choose an ephemeral port.
@@ -941,7 +941,7 @@ You can also check the complete example on [github](https://github.com/etr/libht
941
941
[Back to TOC](#table-of-contents)
942
942
943
943
## IP Blacklisting and Whitelisting
944
-
libhttpserver provides natively a system to blacklist and whitelist IP addresses. To enable/disable the system, it is possible to use the `ban_system` and `no_ban_system` methods on the `create_webserver` class. In the same way, you can specify what you want to be your "default behavior" (allow by default or disallow by default) by using the `default_policy` method (see [here](#create-and-work-with-a-webserver)).
944
+
libhttpserver provides natively a system to blacklist and whitelist IP addresses. To enable/disable the system, it is possible to use the `ban_system(bool enable = true)` method on the `create_webserver` class (`ban_system(false)` to disable). In the same way, you can specify what you want to be your "default behavior" (allow by default or disallow by default) by using the `default_policy` method (see [here](#create-and-work-with-a-webserver)).
945
945
946
946
The system supports both IPV4 and IPV6 and manages them transparently. The only requirement is for ipv6 to be enabled on your server - you'll have to enable this by using the `use_ipv6` method on `create_webserver`.
947
947
@@ -999,11 +999,11 @@ You can also check this example on [github](https://github.com/etr/libhttpserver
999
999
## Authentication
1000
1000
libhttpserver support three types of client authentication.
1001
1001
1002
-
Basic authentication uses a simple authentication method based on BASE64 algorithm. Username and password are exchanged in clear between the client and the server, so this method must only be used for non-sensitive content or when the session is protected with https. When using basic authentication libhttpserver will have access to the clear password, possibly allowing to create a chained authentication toward an external authentication server. You can enable/disable support for Basic authentication through the `basic_auth` and `no_basic_auth` methods of the `create_webserver` class.
1002
+
Basic authentication uses a simple authentication method based on BASE64 algorithm. Username and password are exchanged in clear between the client and the server, so this method must only be used for non-sensitive content or when the session is protected with https. When using basic authentication libhttpserver will have access to the clear password, possibly allowing to create a chained authentication toward an external authentication server. You can enable/disable support for Basic authentication through the `basic_auth(bool enable = true)` method of the `create_webserver` class (`basic_auth(false)` to disable).
1003
1003
1004
-
Digest authentication uses a one-way authentication method based on hash algorithms (MD5, SHA-256, or SHA-512/256). Only the hash will transit over the network, hence protecting the user password. The nonce will prevent replay attacks. This method is appropriate for general use, especially when https is not used to encrypt the session. SHA-256 is the default algorithm; SHA-512/256 is also available for stronger security. You can enable/disable support for Digest authentication through the `digest_auth` and `no_digest_auth` methods of the `create_webserver` class.
1004
+
Digest authentication uses a one-way authentication method based on hash algorithms (MD5, SHA-256, or SHA-512/256). Only the hash will transit over the network, hence protecting the user password. The nonce will prevent replay attacks. This method is appropriate for general use, especially when https is not used to encrypt the session. SHA-256 is the default algorithm; SHA-512/256 is also available for stronger security. You can enable/disable support for Digest authentication through the `digest_auth(bool enable = true)` method of the `create_webserver` class (`digest_auth(false)` to disable).
1005
1005
1006
-
Client certificate authentication uses a X.509 certificate from the client. This is the strongest authentication mechanism but it requires the use of HTTPS. Client certificate authentication can be used simultaneously with Basic or Digest Authentication in order to provide a two levels authentication (like for instance separate machine and user authentication). You can enable/disable support for Certificate authentication through the `use_ssl` and `no_ssl` methods of the `create_webserver` class.
1006
+
Client certificate authentication uses a X.509 certificate from the client. This is the strongest authentication mechanism but it requires the use of HTTPS. Client certificate authentication can be used simultaneously with Basic or Digest Authentication in order to provide a two levels authentication (like for instance separate machine and user authentication). You can enable/disable support for Certificate authentication through the `use_ssl(bool enable = true)` method of the `create_webserver` class (`use_ssl(false)` to disable).
1007
1007
1008
1008
### Using Basic Authentication
1009
1009
```cpp
@@ -1349,7 +1349,7 @@ libhttpserver exposes several methods for integrating with external event loops
1349
1349
*_**unsigned int** webserver::get_active_connections():_ Returns the number of currently active connections.
1350
1350
1351
1351
### External event loop integration
1352
-
When using the server without internal threading (e.g., with `no_listen_socket()` or a single-threaded design), you can drive the event loop yourself:
1352
+
When using the server without internal threading (e.g., with `listen_socket(false)` or a single-threaded design), you can drive the event loop yourself:
1353
1353
*_**bool** webserver::run():_ Process pending events once and return immediately.
1354
1354
*_**bool** webserver::run_wait(**int32_t** millisec):_ Block until events are available or the timeout expires.
1355
1355
*_**bool** webserver::get_fdset(...):_ Retrieve file descriptor sets for use with `select()`.
0 commit comments