From 3ab6732f3776c9575c0098540c048fe693c898d8 Mon Sep 17 00:00:00 2001 From: BV-WebDev <19169837+BV-WebDev@users.noreply.github.com> Date: Thu, 2 Apr 2026 08:52:25 +0000 Subject: [PATCH] adoptSocket: add optional ip parameter for the ip to be correctly set in the open handler --- src/AppWrapper.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/AppWrapper.h b/src/AppWrapper.h index c7a0320e..68635132 100644 --- a/src/AppWrapper.h +++ b/src/AppWrapper.h @@ -758,7 +758,13 @@ void uWS_App_adoptSocket(const FunctionCallbackInfo &args) { int32_t fd = args[0]->Int32Value(isolate->GetCurrentContext()).ToChecked(); - app->adoptSocket(fd); + NativeStringContext nativeStringContext; + NativeString ip(nativeStringContext, isolate, args[1]); + if (ip.isInvalid(args)) { + return; + } + + app->adoptSocket(fd, ip.getString()); args.GetReturnValue().Set(args.This()); }