Skip to content

TCP port check

GET
/connect
const url = 'https://api.dazrik.net/connect?target=example.com&port=443';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}

Checks a TCP port on one public IP for the target hostname or IP address. A closed, refused, or timed-out connection returns HTTP 200 with ok: true and opened: false.

target
required
string

Hostname or IP address to target.

Example

example.com
port
required
integer
>= 1 <= 65535

TCP port (1-65535).

Example

443

Port check result

Media typeapplication/json
object
ok
required
boolean
query
required

The input hostname or IP address

string
address
required

The resolved IP the connection was attempted against

string
port
required
integer
opened
required

Whether the TCP connection succeeded

boolean

Example

{
"ok": true,
"query": "example.com",
"address": "93.184.216.34",
"port": 443,
"opened": true
}
RateLimit
string

Request budget for the current window: limit, remaining, and reset (seconds until the window resets). Returned by known GET endpoints.

Example
limit=60, remaining=59, reset=42
RateLimit-Limit
integer

Maximum requests allowed per client IP per window (60 requests per 60s).

Example
60
RateLimit-Remaining
integer

Requests remaining in the current window before the limit is hit.

Example
59
RateLimit-Reset
integer

Seconds until the current window resets.

Example
42

Missing or invalid parameter

Media typeapplication/json

Error response.

object
ok
required
boolean
msg
required
string

Example

{
"ok": false,
"msg": "query param target is required"
}
RateLimit
string

Request budget for the current window: limit, remaining, and reset (seconds until the window resets). Returned by known GET endpoints.

Example
limit=60, remaining=59, reset=42
RateLimit-Limit
integer

Maximum requests allowed per client IP per window (60 requests per 60s).

Example
60
RateLimit-Remaining
integer

Requests remaining in the current window before the limit is hit.

Example
59
RateLimit-Reset
integer

Seconds until the current window resets.

Example
42

Target resolves to a private/reserved address

Media typeapplication/json

Error response.

object
ok
required
boolean
msg
required
string

Example

{
"ok": false,
"msg": "target doesn't resolve to a public addr"
}
RateLimit
string

Request budget for the current window: limit, remaining, and reset (seconds until the window resets). Returned by known GET endpoints.

Example
limit=60, remaining=59, reset=42
RateLimit-Limit
integer

Maximum requests allowed per client IP per window (60 requests per 60s).

Example
60
RateLimit-Remaining
integer

Requests remaining in the current window before the limit is hit.

Example
59
RateLimit-Reset
integer

Seconds until the current window resets.

Example
42

The request limit of 60 requests per minute per client IP was reached, or /connect or /website requests to the same destination are temporarily limited. The per-client request limit includes Retry-After, the number of seconds until the request budget resets. Destination-limit responses omit that header. A destination limit can apply even when RateLimit-Remaining is greater than zero.

Media typeapplication/json

Error response.

object
ok
required
boolean
msg
required
string

Example

{
"ok": false,
"msg": "you're being rate limited, try again later."
}
RateLimit
string

Request budget for the current window: limit, remaining, and reset (seconds until the window resets). Returned by known GET endpoints.

Example
limit=60, remaining=59, reset=42
RateLimit-Limit
integer

Maximum requests allowed per client IP per window (60 requests per 60s).

Example
60
RateLimit-Remaining
integer

Requests remaining in the current window before the limit is hit.

Example
59
RateLimit-Reset
integer

Seconds until the current window resets.

Example
42
Retry-After
integer

Seconds to wait before retrying after the per-client request limit is reached. Destination connection limits can return HTTP 429 without this header.

Example
42

Unexpected server error

Media typeapplication/json

Error response.

object
ok
required
boolean
msg
required
string

Example

{
"ok": false,
"msg": "unknown error"
}
RateLimit
string

Request budget for the current window: limit, remaining, and reset (seconds until the window resets). Returned by known GET endpoints.

Example
limit=60, remaining=59, reset=42
RateLimit-Limit
integer

Maximum requests allowed per client IP per window (60 requests per 60s).

Example
60
RateLimit-Remaining
integer

Requests remaining in the current window before the limit is hit.

Example
59
RateLimit-Reset
integer

Seconds until the current window resets.

Example
42