aboutsummaryrefslogtreecommitdiff
path: root/test/parallel/test-inspector-reported-host.js
blob: f54ea16625d218cbf3504dca4bc8e7000552c0a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Flags: --expose-internals
'use strict';
const common = require('../common');

common.skipIfInspectorDisabled();

const assert = require('assert');
const { NodeInstance } = require('../common/inspector-helper.js');

common.crashOnUnhandledRejection();

async function test() {
  const madeUpHost = '111.111.111.111:11111';
  const child = new NodeInstance(undefined, 'var a = 1');
  const response = await child.httpGet(null, '/json', madeUpHost);
  assert.ok(
    response[0].webSocketDebuggerUrl.startsWith(`ws://${madeUpHost}`),
    response[0].webSocketDebuggerUrl);
  child.kill();
}

test();