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
- Added `max_header_len` option to limit the maximum allowed header
size during the WebSocket upgrade process.
- Added `validate_handshake` option to enforce that the WebSocket
handshake response must return HTTP 101.
- Improved HTTP response parsing by checking the status line and
extracting response headers properly.
- Added new test cases
Copy file name to clipboardExpand all lines: README.markdown
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -185,12 +185,18 @@ An optional options table can be specified. The following options are as follows
185
185
*`max_send_len`
186
186
187
187
Specifies the maximal length of payload allowed when sending WebSocket frames. Defaults to the value of `max_payload_len`.
188
+
*`max_header_len`
189
+
190
+
Specifies the maximal length of payload allowed when receiving headers during the WebSocket upgrade process. Defaults to `0`, disabling the check allowing unlimited length.
188
191
*`send_masked`
189
192
190
193
Specifies whether to send out masked WebSocket frames. When it is `true`, masked frames are always sent. Default to `false`.
191
194
*`timeout`
192
195
193
196
Specifies the network timeout threshold in milliseconds. You can change this setting later via the `set_timeout` method call. Note that this timeout setting does not affect the HTTP response header sending process for the websocket handshake; you need to configure the [send_timeout](http://nginx.org/en/docs/http/ngx_http_core_module.html#send_timeout) directive at the same time.
197
+
*`validate_handshake`
198
+
199
+
Specifies whether to ensure the WebSocket upgrade returned an HTTP 101 status code. When the handshake fails, both the HTTP status code & response body will be captured in the returned error message. Default to `false`.
0 commit comments