API Reference / Proxy sessions
Find proxy sessions by host and port
Returns every live session in your workspace, in any pool, whose host and port equal one of the given endpoints, with the pool it is in. Host names compare case-insensitively and IPv6 addresses compare as addresses, so a bracketed and a bare form match. An endpoint held by several sessions returns one match for each, ordered by the endpoint's position in the request and then by pool name. At most 10000 endpoints a call.
/ proxies. v1. Proxies/ MatchSessionEndpointsRequest body
application/jsonRequired
Request to find the workspace's sessions at the given endpoints.
endpoints?array<ProxyEndpoint>The endpoints to look for, at most 10000. More is rejected with invalid_argument.
Show attributes
host?stringHost name or IP address. Host names compare case-insensitively. An IPv6 address may be bare or in brackets.
port?integerTCP port.
Format"int32"
Response body
application/json
Success
matches?array<SessionEndpointMatch>The matches, one per session. An endpoint with no session has none.
Show attributes
index?integerPosition of the matched endpoint in the request, from zero.
Format"int32"
poolId?stringOpaque 16-byte identifier of the pool the session is in, base64-encoded in JSON.
Format"byte" base64
poolName?stringName of the pool the session is in.
sessionId?stringOpaque 16-byte identifier of the session, base64-encoded in JSON.
Format"byte" base64
application/json
The request was malformed, such as a missing required field or an unparseable cursor. The request cannot be carried out in the current system state.
codestringThe Connect error code, such as "not_found".
details?array<object>Optional machine-readable error details.
messagestringA human-readable description of the error.
application/json
The request lacks a valid API key in the Authorization header.
codestringThe Connect error code, such as "not_found".
details?array<object>Optional machine-readable error details.
messagestringA human-readable description of the error.
application/json
The API key is not allowed to perform this action on this workspace.
codestringThe Connect error code, such as "not_found".
details?array<object>Optional machine-readable error details.
messagestringA human-readable description of the error.
application/json
The request was rate limited. Slow down and retry later.
codestringThe Connect error code, such as "not_found".
details?array<object>Optional machine-readable error details.
messagestringA human-readable description of the error.
application/json
An internal server error occurred.
codestringThe Connect error code, such as "not_found".
details?array<object>Optional machine-readable error details.
messagestringA human-readable description of the error.
application/json
The service is temporarily unavailable. Retry with backoff.
codestringThe Connect error code, such as "not_found".
details?array<object>Optional machine-readable error details.
messagestringA human-readable description of the error.
curl -X POST "https://api.goldmine.to/proxies.v1.Proxies/MatchSessionEndpoints" \
-H "Authorization: Bearer $CSTRADER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"endpoints": [
{
"host": "203.0.113.10",
"port": 8080
},
{
"host": "proxy.example.com",
"port": 3128
}
]
}'const res = await fetch("https://api.goldmine.to/proxies.v1.Proxies/MatchSessionEndpoints", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.CSTRADER_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"endpoints": [
{
"host": "203.0.113.10",
"port": 8080
},
{
"host": "proxy.example.com",
"port": 3128
}
]
}),
});
const data = await res.json();body := strings.NewReader(`{
"endpoints": [
{
"host": "203.0.113.10",
"port": 8080
},
{
"host": "proxy.example.com",
"port": 3128
}
]
}`)
req, err := http.NewRequestWithContext(ctx, http.MethodPost, "https://api.goldmine.to/proxies.v1.Proxies/MatchSessionEndpoints", body)
if err != nil {
return err
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("CSTRADER_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)import os, requests
res = requests.post(
"https://api.goldmine.to/proxies.v1.Proxies/MatchSessionEndpoints",
headers={"Authorization": f"Bearer {os.environ['CSTRADER_API_KEY']}"},
json={
"endpoints": [
{
"host": "203.0.113.10",
"port": 8080
},
{
"host": "proxy.example.com",
"port": 3128
}
]
},
)
data = res.json(){
"matches": [
{
"index": 0,
"sessionId": "AY+MIjMzfu6P/05OTk5OTg==",
"poolId": "AY+MISIifMyN3T09PT09PQ==",
"poolName": "imported-proxies"
}
]
}{
"code": "failed_precondition",
"message": "The request cannot be carried out in the current system state."
}{
"code": "unauthenticated",
"message": "The request lacks a valid API key in the Authorization header."
}{
"code": "permission_denied",
"message": "The API key is not allowed to perform this action on this workspace."
}{
"code": "resource_exhausted",
"message": "The request was rate limited. Slow down and retry later."
}{
"code": "internal",
"message": "An internal server error occurred."
}{
"code": "unavailable",
"message": "The service is temporarily unavailable. Retry with backoff."
}