diff options
| author | cbdev <cb@cbcdn.com> | 2019-05-19 17:53:23 +0200 |
|---|---|---|
| committer | cbdev <cb@cbcdn.com> | 2019-05-19 17:53:23 +0200 |
| commit | de23df891940464080297cd9b17324d8ee4601d7 (patch) | |
| tree | f181b1620f1dfc073a32a65a55f089c3b3d1cd05 /builtins.c | |
| parent | 92638847a3b7f51fb795c7986b793536ece6beee (diff) | |
| download | websocksy-de23df891940464080297cd9b17324d8ee4601d7.tar.gz websocksy-de23df891940464080297cd9b17324d8ee4601d7.tar.bz2 websocksy-de23df891940464080297cd9b17324d8ee4601d7.zip | |
Implement basic peer connection handling
Diffstat (limited to 'builtins.c')
| -rw-r--r-- | builtins.c | 33 |
1 files changed, 29 insertions, 4 deletions
@@ -1,11 +1,36 @@ static ws_peer_info default_peer = { - 0 + .transport = peer_tcp_client, + .host = "localhost", + .port = "5900" }; +//TODO backend configuration ws_peer_info backend_defaultpeer_query(char* endpoint, size_t protocols, char** protocol, size_t headers, ws_http_header* header, websocket* ws){ //return a copy of the default peer - ws_peer_info peer = { - 0 - }; + ws_peer_info peer = default_peer; + peer.host = (default_peer.host) ? strdup(default_peer.host) : NULL; + peer.port = (default_peer.port) ? strdup(default_peer.port) : NULL; + + //TODO backend protocol discovery + peer.protocol = protocols; return peer; } + +int64_t framing_auto(uint8_t* data, size_t length, size_t last_read, ws_operation* opcode, void** framing_data, char* config){ + //TODO implement auto framer + return length; +} + +int64_t framing_binary(uint8_t* data, size_t length, size_t last_read, ws_operation* opcode, void** framing_data, char* config){ + return length; +} + +int64_t framing_separator(uint8_t* data, size_t length, size_t last_read, ws_operation* opcode, void** framing_data, char* config){ + //TODO implement separator framer + return length; +} + +int64_t framing_newline(uint8_t* data, size_t length, size_t last_read, ws_operation* opcode, void** framing_data, char* config){ + //TODO implement separator framer + return length; +} |
