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);
}

Resolves the target to a single public IP and attempts a TCP connection to the given port.

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 validated input target

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

IETF-draft combined rate-limit header for the current window: limit, remaining, and reset (seconds until the window resets). Sent on every response from a known endpoint.

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

IETF-draft combined rate-limit header for the current window: limit, remaining, and reset (seconds until the window resets). Sent on every response from a known endpoint.

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

IETF-draft combined rate-limit header for the current window: limit, remaining, and reset (seconds until the window resets). Sent on every response from a known endpoint.

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

Rate limit exceeded: either the per-client request limit (60 requests per minute) or, for endpoints that connect to the target, the per-destination outbound connection limit.

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

IETF-draft combined rate-limit header for the current window: limit, remaining, and reset (seconds until the window resets). Sent on every response from a known endpoint.

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. Sent only on a 429 response.

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

IETF-draft combined rate-limit header for the current window: limit, remaining, and reset (seconds until the window resets). Sent on every response from a known endpoint.

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