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