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

feat(transport): Add binary support #350

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

RealAlphabet
Copy link

This PR introduce breaking changes on the API and is currently a draft.

Currently the library constantly serialises binary responses in text (base64) which is extremely inefficient for certain types of response such as images and videos. This library introduces full support for binary responses by proxying the binary response data directly via WebSocket.

Breaking changes introduced

  • To introduce this behaviour, I had to change the messages communicated by the Go instance from JSON to binary. There are no other solutions for this type of data. This requires a user wishing to use CycleTLS from an external program to read the binary format returned by the WebSocket server.
  • The JavaScript library has been modified to read the binary data response sent by the CycleTLS WebSocket server. The methods return an object similar to the browser fetch API.

Future changes

  • Document the binary communication protocol.
  • Return an instance of IncomingMessage for NodeJS.
  • Support for cancelable requests via AbortController.
  • Stream support.

@RealAlphabet RealAlphabet marked this pull request as draft August 10, 2024 13:11
@Danny-Dasilva Danny-Dasilva marked this pull request as ready for review August 10, 2024 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants