Proxy is working

parent cb06629b
This diff is collapsed.
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
#include "html_pages/novnc_input_fixedkeys_js_page.h" #include "html_pages/novnc_input_fixedkeys_js_page.h"
#include "html_pages/novnc_input_gesturehandler_js_page.h" #include "html_pages/novnc_input_gesturehandler_js_page.h"
#include "html_pages/novnc_input_keyboard_js_page.h" #include "html_pages/novnc_input_keyboard_js_page.h"
#include "html_pages/novnc_input_keysym_js_page.h"
#include "html_pages/novnc_input_keysymdef_js_page.h" #include "html_pages/novnc_input_keysymdef_js_page.h"
#include "html_pages/novnc_input_keysym_js_page.h"
#include "html_pages/novnc_input_util_js_page.h" #include "html_pages/novnc_input_util_js_page.h"
#include "html_pages/novnc_input_vkeys_js_page.h" #include "html_pages/novnc_input_vkeys_js_page.h"
#include "html_pages/novnc_input_xtscancodes_js_page.h" #include "html_pages/novnc_input_xtscancodes_js_page.h"
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
#include "html_pages/rdp_clipboard_js_page.h" #include "html_pages/rdp_clipboard_js_page.h"
#include "html_pages/rdp_mstsc_js_page.h" #include "html_pages/rdp_mstsc_js_page.h"
#include "html_pages/rdp_out_stream_js_page.h" #include "html_pages/rdp_out_stream_js_page.h"
#include "html_pages/rdp_rdp_wasm_js_page.h"
#include "html_pages/rdp_rdp_graphics_js_page.h" #include "html_pages/rdp_rdp_graphics_js_page.h"
#include "html_pages/rdp_rdp_wasm_js_page.h"
#include "html_pages/rdp_reversed_layouts_js_page.h" #include "html_pages/rdp_reversed_layouts_js_page.h"
#include "html_pages/rdp_scancodes_js_page.h" #include "html_pages/rdp_scancodes_js_page.h"
#include "html_pages/rdp_rdp_wasm_page.h" #include "html_pages/rdp_rdp_wasm_page.h"
......
...@@ -48,6 +48,7 @@ static const char *TUNNEL_REQUEST_MSG = "{\"type\":\"tunnel_request\",\"request_ ...@@ -48,6 +48,7 @@ static const char *TUNNEL_REQUEST_MSG = "{\"type\":\"tunnel_request\",\"request_
static const char *TUNNEL_ACK_MSG = "{\"type\":\"tunnel_ack\",\"request_id\":\"%s\"}"; static const char *TUNNEL_ACK_MSG = "{\"type\":\"tunnel_ack\",\"request_id\":\"%s\"}";
static const char *TUNNEL_ERROR_MSG = "{\"type\":\"tunnel_error\",\"request_id\":\"%s\",\"error\":\"%s\"}"; static const char *TUNNEL_ERROR_MSG = "{\"type\":\"tunnel_error\",\"request_id\":\"%s\",\"error\":\"%s\"}";
void format_bytes(unsigned long long bytes, char *buffer, size_t buffer_size) { void format_bytes(unsigned long long bytes, char *buffer, size_t buffer_size) {
if (bytes < 1024) { if (bytes < 1024) {
snprintf(buffer, buffer_size, "%llu B", bytes); snprintf(buffer, buffer_size, "%llu B", bytes);
...@@ -887,9 +888,13 @@ int websocket_handle_message(wssshd_state_t *state, ws_connection_t *conn __attr ...@@ -887,9 +888,13 @@ int websocket_handle_message(wssshd_state_t *state, ws_connection_t *conn __attr
if (request_id) { if (request_id) {
// Find the tunnel and mark it as acknowledged // Find the tunnel and mark it as acknowledged
// This is a simple acknowledgment - in a full implementation, tunnel_t *tunnel = websocket_find_tunnel(state, request_id);
// you might want to track tunnel state more thoroughly if (tunnel) {
if (state->debug) printf("[DEBUG - %s -> wssshd] Tunnel %s acknowledged by client\n", direction, request_id); tunnel_update_status(tunnel, TUNNEL_STATUS_ACTIVE, NULL);
if (state->debug) printf("[DEBUG - %s -> wssshd] Tunnel %s acknowledged by client and set to ACTIVE\n", direction, request_id);
} else {
if (state->debug) printf("[DEBUG - %s -> wssshd] Tunnel %s not found for acknowledgment\n", direction, request_id);
}
} }
if (request_id) free(request_id); if (request_id) free(request_id);
...@@ -1072,6 +1077,7 @@ int websocket_handle_message(wssshd_state_t *state, ws_connection_t *conn __attr ...@@ -1072,6 +1077,7 @@ int websocket_handle_message(wssshd_state_t *state, ws_connection_t *conn __attr
// Find the tunnel // Find the tunnel
tunnel_t *tunnel = websocket_find_tunnel(state, request_id); tunnel_t *tunnel = websocket_find_tunnel(state, request_id);
if (tunnel) { if (tunnel) {
// Normal tunnel forwarding
// Determine which side to forward to based on sender // Determine which side to forward to based on sender
ws_connection_t *target_conn = NULL; ws_connection_t *target_conn = NULL;
const char *target_side = NULL; const char *target_side = NULL;
......
...@@ -107,6 +107,8 @@ char *base64_encode(const unsigned char *data, size_t len) { ...@@ -107,6 +107,8 @@ char *base64_encode(const unsigned char *data, size_t len) {
return out; return out;
} }
// Compute WebSocket accept key // Compute WebSocket accept key
char *ws_compute_accept_key(const char *key) { char *ws_compute_accept_key(const char *key) {
if (!key) return NULL; if (!key) return NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment