Skip to content

Commit 766aa0f

Browse files
Merge pull request #320 from lightpanda-io/http_json_version
websockets: add addr server info in Stream
2 parents b846541 + 8ef79e3 commit 766aa0f

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
@@ -26,6 +26,9 @@ const log = std.log.scoped(.handler);
2626
pub const Stream = struct {
2727
addr: std.net.Address,
2828
socket: std.posix.socket_t = undefined,
29+
30+
ws_host: []const u8,
31+
ws_port: u16,
2932
ws_conn: *ws.Conn = undefined,
3033

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

src/main.zig

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

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

0 commit comments

Comments
 (0)