Skip to content

[Selenium 4] [Grid] Se:Options CDP Endpoint Points to Node #9202

@dylanlive

Description

@dylanlive

🐛 Bug Report

When making a POST /session request to a Selenium 4 Grid Hub, the returned CDP Endpoint points to the node.

Example:

{
    "status": 0,
    "sessionId": "c8adfc6384648299d726d9c63d4e7a15",
    "value": {
        "se:options": {
            "cdp": "http://<node_ip>:5555/session/c8adfc6384648299d726d9c63d4e7a15/se/cdp"
         },
    }
}

Is it intended to not prefer proxying these requests through the Hub (4444)? For WebdriverIO I'm hoping to utilize the URL returned from this response.

For security purposes, I would prefer to lock my Nodes down to only be able to communicate with the Hub, and not have the clients making individual requests to the node.

From my tests back in Alpha, cdp websocket requests to both hub (4444) and node (5555) both were working. So this is more of a decision on which should be advertised.

To Reproduce

  1. Launch a Selenium 4 Hub/Node
  2. Make a POST /session request

Expected behavior

Response to be:

{
    "status": 0,
    "sessionId": "c8adfc6384648299d726d9c63d4e7a15",
    "value": {
        "se:options": {
            "cdp": "http://<hub_ip>:4444/session/c8adfc6384648299d726d9c63d4e7a15/se/cdp"
         },
    }
}

Test script or set of commands reproducing this issue

curl -d ' {"desiredCapabilities": { "browserName": "chrome" }}' -H 'Content-Type: application/json; charset=utf-8' http://localhost:4444/session

Environment

OS: 10
Browser: Chrome
Browser version: 88.0.4324.150
Browser Driver version: 88.0.4324.96
Language Bindings version: n/a
Selenium Grid version (if applicable): 4.0.0-beta-1

Metadata

Metadata

Assignees

No one assigned

    Labels

    B-gridEverything grid and server relatedC-javaJava Bindings

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions