websockets: add addr server info in Stream

Signed-off-by: Francis Bouvier <francis@lightpanda.io>
This commit is contained in:
Francis Bouvier
2024-12-04 12:05:11 +01:00
parent 3088c7a632
commit 8ef79e348c
3 changed files with 9 additions and 2 deletions

View File

@@ -25,6 +25,9 @@ const log = std.log.scoped(.handler);
pub const Stream = struct {
addr: std.net.Address,
socket: std.posix.socket_t = undefined,
ws_host: []const u8,
ws_port: u16,
ws_conn: *ws.Conn = undefined,
fn connectCDP(self: *Stream) !void {

View File

@@ -263,7 +263,11 @@ pub fn main() !void {
}
// start stream server in separate thread
var stream = handler.Stream{ .addr = addr };
var stream = handler.Stream{
.ws_host = opts.host,
.ws_port = opts.port,
.addr = addr,
};
const cdp_thread = try std.Thread.spawn(
.{ .allocator = alloc },
server.handle,