|
22 | 22 |
|
23 | 23 | //! <img src="https://static.wikia.nocookie.net/arnelify/images/c/c8/Arnelify-logo-2024.png/revision/latest?cb=20240701012515" style="width:336px;" alt="Arnelify Logo" /> |
24 | 24 | //! |
25 | | -//!  |
| 25 | +//!  |
26 | 26 | //!  |
27 | 27 | //!  |
28 | 28 | //! |
|
206 | 206 | //! | - | - | |
207 | 207 | //! | **BLOCK_SIZE_KB**| The size of the allocated memory used for processing large packets. | |
208 | 208 | //! | **COMPRESSION**| If this option is enabled, the server will use BROTLI compression if the client application supports it. This setting increases CPU resource consumption. The server will not use compression if the data size exceeds the value of **BLOCK_SIZE_KB**. | |
209 | | -//! | **HANDSHAKE_TIMEOUT**| Maximum time in seconds to complete the TLS handshake. | |
210 | 209 | //! | **MAX_MESSAGE_SIZE_MB**| Maximum size of a single message the server will accept from a client. | |
211 | 210 | //! | **PING_TIMEOUT**| Maximum time the server will wait for a ping from the client. | |
212 | 211 | //! | **PORT**| Defines which port the server will listen on. | |
213 | | -//! | **SEND_TIMEOUT**| Maximum time for the client to receive a response from the server. | |
| 212 | +//! | **RATE_LIMIT**| Defines the maximum number of connections allowed from a single IP address. | |
| 213 | +//! | **READ_TIMEOUT**| Maximum time allowed for a client to send a request to the server. | |
| 214 | +//! | **SEND_TIMEOUT**| Maximum time allowed for the client to receive a response from the server. | |
214 | 215 | //! | **THREAD_LIMIT**| Defines the maximum number of threads that will handle requests.| |
215 | 216 | //! |
216 | 217 | //! ## Examples |
|
231 | 232 | //! let ws_opts: WebSocketOpts = WebSocketOpts { |
232 | 233 | //! block_size_kb: 64, |
233 | 234 | //! compression: false, |
234 | | -//! handshake_timeout: 30, |
235 | 235 | //! max_message_size_kb: 64, |
236 | 236 | //! ping_timeout: 15, |
237 | 237 | //! port: 4433, |
| 238 | +//! rate_limit: 5, |
| 239 | +//! read_timeout: 30, |
238 | 240 | //! send_timeout: 30, |
239 | | -//! thread_limit: 4, |
| 241 | +//! thread_limit: 4 |
240 | 242 | //! }; |
241 | 243 | //! |
242 | 244 | //! let ws: WebSocket = WebSocket::new(ws_opts); |
|
450 | 452 | //! ``` |
451 | 453 | //! # Release Notes |
452 | 454 | //! |
453 | | -//! Version 0.9.8 — a multi-language server with HTTP 3.0 and WebTransport support. |
| 455 | +//! Version 1.0.8 — a multi-language server with HTTP 3.0 and WebTransport support. |
454 | 456 | //! |
455 | 457 | //! We are excited to introduce the Arnelify Server for Rust! Please note that this version is raw and still in active development. |
456 | 458 | //! |
@@ -1477,10 +1479,11 @@ pub extern "C" fn ws_create(c_opts: *const c_char) -> c_int { |
1477 | 1479 | let ws_opts: WebSocketOpts = WebSocketOpts { |
1478 | 1480 | block_size_kb: get_usize(&opts, "block_size_kb"), |
1479 | 1481 | compression: get_bool(&opts, "compression"), |
1480 | | - handshake_timeout: get_u64(&opts, "handshake_timeout"), |
1481 | 1482 | max_message_size_kb: get_u64(&opts, "max_message_size_kb"), |
1482 | 1483 | ping_timeout: get_u64(&opts, "ping_timeout"), |
1483 | 1484 | port: get_u16(&opts, "port"), |
| 1485 | + rate_limit: get_u64(&opts, "rate_limit"), |
| 1486 | + read_timeout: get_u64(&opts, "read_timeout"), |
1484 | 1487 | send_timeout: get_u64(&opts, "send_timeout"), |
1485 | 1488 | thread_limit: get_u64(&opts, "thread_limit"), |
1486 | 1489 | }; |
|
0 commit comments