Skip to content

Instantly share code, notes, and snippets.

@creationix
Created March 9, 2021 20:30
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save creationix/90efdf3f7dd463d28310fdb981e33663 to your computer and use it in GitHub Desktop.
Save creationix/90efdf3f7dd463d28310fdb981e33663 to your computer and use it in GitHub Desktop.
#include <stdint.h>
#include <unistd.h>
typedef struct {
uint8_t* ptr;
size_t len;
} slice_t;
typedef struct {
slice_t* ptr;
size_t len;
} slices_t;
extern void sendText(void* client, slice_t message);
extern void sendBinary(void* client, slice_t message);
extern void close(void* client);
void onConnect(void* client, slice_t url, slices_t headers);
void onText(void* client, slice_t message);
void onBinary(void* client, slice_t message);
void onClose(void* client);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment