fix #28: ipv6 target parse fix
parent
d09f31898d
commit
50fb6a429b
|
|
@ -16,8 +16,9 @@ export async function getStatus(
|
|||
if (monitor.method === 'TCP_PING') {
|
||||
// TCP port endpoint monitor
|
||||
try {
|
||||
const [hostname, port] = monitor.target.split(':')
|
||||
const socket = connect({ hostname: hostname, port: Number(port) })
|
||||
// This is not a real https connection, but we need to add a dummy `https://` to parse the hostname & port
|
||||
const parsed = new URL("https://" + monitor.target)
|
||||
const socket = connect({ hostname: parsed.hostname, port: Number(parsed.port) })
|
||||
|
||||
// Now we have an `opened` promise!
|
||||
// @ts-ignore
|
||||
|
|
|
|||
Loading…
Reference in New Issue