From 3bb2d8fd96618c11f499c8dddb97a62015b1ea53 Mon Sep 17 00:00:00 2001 From: cbdev Date: Sat, 8 Jun 2019 11:25:19 +0200 Subject: Implement configuration file parsing --- websocksy.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'websocksy.c') diff --git a/websocksy.c b/websocksy.c index f948727..33ee794 100644 --- a/websocksy.c +++ b/websocksy.c @@ -22,7 +22,6 @@ /* TODO * - TLS - * - config file * - pings */ @@ -44,8 +43,8 @@ char* xstr_lower(char* in){ /* Daemon configuration */ static ws_config config = { - .host = DEFAULT_HOST, - .port = DEFAULT_PORT, + .host = NULL, + .port = NULL, /* Assign the built-in defaultpeer backend by default */ .backend.init = backend_defaultpeer_init, .backend.config = backend_defaultpeer_configure, @@ -80,6 +79,7 @@ int client_register(websocket* ws){ return 0; } +/* Clean up and close all connections */ void client_cleanup(){ size_t n; for(n = 0; n < socks; n++){ @@ -201,6 +201,7 @@ static void signal_handler(int signum){ static int usage(char* fn){ fprintf(stderr, "\nwebsocksy v%s - Proxy between websockets and 'real' sockets\n", WEBSOCKSY_VERSION); fprintf(stderr, "Usage:\n"); + fprintf(stderr, "\t%s \n", fn); fprintf(stderr, "\t%s [-p ] [-l ] [-b ] [-c