Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for proxying in WebsocketClient #130

Merged
merged 4 commits into from
Apr 11, 2023
Merged

Commits on Mar 7, 2023

  1. WebsocketClient supports proxying

    Added support for TLS and plain text proxying of Websocket traffic.
    
    In the TLS case a CONNECT header is first sent establishing the proxied
    traffic.
    
    In the plain text case the modified URI in the initial upgrade request
    header indicates to the proxy server that the traffic is to be proxied.
    
    Use `NIOWebSocketFrameAggregator` to handle aggregating frame
    fragments. This brings with it more protections e.g. against memory
    exhaustion.
    
    Accompanying config has been added to support this change.
    rnro committed Mar 7, 2023
    Configuration menu
    Copy the full SHA
    a6b53a6 View commit details
    Browse the repository at this point in the history
  2. Reduce allocations and copies in WebSocket.send

    Reduce allocation and copies necessary to send `ByteBuffer` and `ByteBufferView` through `WebSocket.send`.
    
    In fact sending `ByteBuffer` or `ByteBufferView` doesn’t require any allocation or copy of the data. Sending a `String` now correctly pre allocates the `ByteBuffer` if multibyte characters are present in the `String`.
    
    Remove custom random websocket mask generation which would only generate bytes between `UInt8.min..<UInt8.max`, therefore excluding `UInt8.max` aka `255`.
    rnro committed Mar 7, 2023
    Configuration menu
    Copy the full SHA
    a10f856 View commit details
    Browse the repository at this point in the history
  3. add DocC comments

    rnro committed Mar 7, 2023
    Configuration menu
    Copy the full SHA
    e5cfcea View commit details
    Browse the repository at this point in the history
  4. DocC comments for new APIs

    rnro committed Mar 7, 2023
    Configuration menu
    Copy the full SHA
    777ef32 View commit details
    Browse the repository at this point in the history