Skip to content

Commit 61315a4

Browse files
authored
Merge pull request #1125 from LibertyGlobal/jmanko/webinspector_internal_port
[Inspector] Use static port for internal webinspector communication
2 parents 03e4e6e + 21f55e4 commit 61315a4

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

Source/WebKit/UIProcess/API/glib/WebKitInitialize.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include <mutex>
3535
#include <wtf/glib/GRefPtr.h>
3636
#include <wtf/glib/GUniquePtr.h>
37+
#include <wtf/text/StringToIntegerConversion.h>
3738

3839
namespace WebKit {
3940

@@ -75,8 +76,11 @@ static void initializeRemoteInspectorServer()
7576

7677
auto inspectorHTTPAddress = parseAddress(httpAddress);
7778
GRefPtr<GSocketAddress> inspectorAddress;
78-
if (inspectorHTTPAddress)
79-
inspectorAddress = adoptGRef(G_SOCKET_ADDRESS(g_inet_socket_address_new(g_inet_socket_address_get_address(G_INET_SOCKET_ADDRESS(inspectorHTTPAddress.get())), 0)));
79+
if (inspectorHTTPAddress) {
80+
String envVar = String::fromLatin1(getenv("WEBKIT_INSPECTOR_PORT"));
81+
auto port = parseInteger<uint16_t>(envVar).value_or(0);
82+
inspectorAddress = adoptGRef(G_SOCKET_ADDRESS(g_inet_socket_address_new(g_inet_socket_address_get_address(G_INET_SOCKET_ADDRESS(inspectorHTTPAddress.get())), port)));
83+
}
8084
else
8185
inspectorAddress = parseAddress(address);
8286
if (!inspectorHTTPAddress && !inspectorAddress) {

0 commit comments

Comments
 (0)