Skip to content

Commit 8ef79e3

Browse files
websockets: add addr server info in Stream
Signed-off-by: Francis Bouvier <[email protected]>
1 parent 3088c7a commit 8ef79e3

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

src/handler.zig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ const log = std.log.scoped(.handler);
2525
pub const Stream = struct {
2626
addr: std.net.Address,
2727
socket: std.posix.socket_t = undefined,
28+
29+
ws_host: []const u8,
30+
ws_port: u16,
2831
ws_conn: *ws.Conn = undefined,
2932

3033
fn connectCDP(self: *Stream) !void {

src/main.zig

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,11 @@ pub fn main() !void {
263263
}
264264

265265
// start stream server in separate thread
266-
var stream = handler.Stream{ .addr = addr };
266+
var stream = handler.Stream{
267+
.ws_host = opts.host,
268+
.ws_port = opts.port,
269+
.addr = addr,
270+
};
267271
const cdp_thread = try std.Thread.spawn(
268272
.{ .allocator = alloc },
269273
server.handle,

0 commit comments

Comments
 (0)