From 92638847a3b7f51fb795c7986b793536ece6beee Mon Sep 17 00:00:00 2001 From: cbdev Date: Sun, 19 May 2019 11:03:45 +0200 Subject: Documentation & peer discovery API --- websocksy.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'websocksy.c') diff --git a/websocksy.c b/websocksy.c index 55e8d35..714c3f5 100644 --- a/websocksy.c +++ b/websocksy.c @@ -37,7 +37,7 @@ char* xstr_lower(char* in){ } #include "network.c" -#include "ws_proto.c" +#include "builtins.c" /* * WebSocket interface & peer discovery configuration @@ -48,9 +48,17 @@ static struct { ws_backend backend; } config = { .host = "::", - .port = "8001" + .port = "8001", + .backend.query = backend_defaultpeer_query }; +int connect_peer(websocket* ws){ + ws->peer = config.backend.query(ws->request_path, ws->protocols, ws->protocol, ws->headers, ws->header, ws); + return 0; +} + +#include "ws_proto.c" + /* * Signal handler, attached to SIGINT */ -- cgit v1.2.3