curl --request POST \
--url https://use.hoop.dev/api/proxymanager/connect \
--header 'Content-Type: application/json' \
--data '
{
"connection_name": "pgdemo",
"port": "5432",
"access_duration": 1800000000000
}
'import requests
url = "https://use.hoop.dev/api/proxymanager/connect"
payload = {
"connection_name": "pgdemo",
"port": "5432",
"access_duration": 1800000000000
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({connection_name: 'pgdemo', port: '5432', access_duration: 1800000000000})
};
fetch('https://use.hoop.dev/api/proxymanager/connect', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://use.hoop.dev/api/proxymanager/connect",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'connection_name' => 'pgdemo',
'port' => '5432',
'access_duration' => 1800000000000
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://use.hoop.dev/api/proxymanager/connect"
payload := strings.NewReader("{\n \"connection_name\": \"pgdemo\",\n \"port\": \"5432\",\n \"access_duration\": 1800000000000\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://use.hoop.dev/api/proxymanager/connect")
.header("Content-Type", "application/json")
.body("{\n \"connection_name\": \"pgdemo\",\n \"port\": \"5432\",\n \"access_duration\": 1800000000000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://use.hoop.dev/api/proxymanager/connect")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"connection_name\": \"pgdemo\",\n \"port\": \"5432\",\n \"access_duration\": 1800000000000\n}"
response = http.request(request)
puts response.read_body{
"access_duration": 1800000000000,
"connected-at": "2024-07-25T19:36:41Z",
"connection_name": "<string>",
"connection_subtype": "<string>",
"connection_type": "<string>",
"has_review": true,
"id": "20A5AABE-C35D-4F04-A5A7-C856EE6C7703",
"metadata": {
"go-version": "1.22.4",
"hostname": "johnwick.local",
"platform": "amd64",
"session": "15B3C616-6B43-4F85-B4FD-B83378A866C2",
"version": "1.23.4"
},
"port": "<string>",
"status": "ready"
}{
"message": "the error description"
}{
"message": "the error description"
}{
"message": "the error description"
}{
"message": "the error description"
}ProxyManager Connect
Send a connect request to the client. A successful response indicates the client has stablished a connection.
If the connection resource has the review enabled, it returns a successful response containing the link of the review in the Localtion header.
curl --request POST \
--url https://use.hoop.dev/api/proxymanager/connect \
--header 'Content-Type: application/json' \
--data '
{
"connection_name": "pgdemo",
"port": "5432",
"access_duration": 1800000000000
}
'import requests
url = "https://use.hoop.dev/api/proxymanager/connect"
payload = {
"connection_name": "pgdemo",
"port": "5432",
"access_duration": 1800000000000
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({connection_name: 'pgdemo', port: '5432', access_duration: 1800000000000})
};
fetch('https://use.hoop.dev/api/proxymanager/connect', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://use.hoop.dev/api/proxymanager/connect",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'connection_name' => 'pgdemo',
'port' => '5432',
'access_duration' => 1800000000000
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://use.hoop.dev/api/proxymanager/connect"
payload := strings.NewReader("{\n \"connection_name\": \"pgdemo\",\n \"port\": \"5432\",\n \"access_duration\": 1800000000000\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://use.hoop.dev/api/proxymanager/connect")
.header("Content-Type", "application/json")
.body("{\n \"connection_name\": \"pgdemo\",\n \"port\": \"5432\",\n \"access_duration\": 1800000000000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://use.hoop.dev/api/proxymanager/connect")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"connection_name\": \"pgdemo\",\n \"port\": \"5432\",\n \"access_duration\": 1800000000000\n}"
response = http.request(request)
puts response.read_body{
"access_duration": 1800000000000,
"connected-at": "2024-07-25T19:36:41Z",
"connection_name": "<string>",
"connection_subtype": "<string>",
"connection_type": "<string>",
"has_review": true,
"id": "20A5AABE-C35D-4F04-A5A7-C856EE6C7703",
"metadata": {
"go-version": "1.22.4",
"hostname": "johnwick.local",
"platform": "amd64",
"session": "15B3C616-6B43-4F85-B4FD-B83378A866C2",
"version": "1.23.4"
},
"port": "<string>",
"status": "ready"
}{
"message": "the error description"
}{
"message": "the error description"
}{
"message": "the error description"
}{
"message": "the error description"
}Body
The request body resource
Response
OK
The request access duration in case of review
1800000000000
The time (RFC3339) when the client connect
"2024-07-25T19:36:41Z"
The requested connection name
The requested connection subtype
The requested connection type
Report if the connection has a review
Deterministic uuid identifier of the user
"20A5AABE-C35D-4F04-A5A7-C856EE6C7703"
Metadata information about the client
Show child attributes
Show child attributes
{
"go-version": "1.22.4",
"hostname": "johnwick.local",
"platform": "amd64",
"session": "15B3C616-6B43-4F85-B4FD-B83378A866C2",
"version": "1.23.4"
}
The requested client port to listen
The status of the connection request
- ready - indicates the grpc client is ready to subscribe to a new connection
- connected - indicates the client has opened a new session
- disconnected - indicates the grpc client has disconnected
ready, connected, disconnected Was this page helpful?