---
title: "WebSocket wire protocol proxy - Xata"
description: "Upgrade to a WebSocket connection that proxies the PostgreSQL wire protocol. The client sends and receives PostgreSQL protocol messages over binary WebSocket frames. Authentication: the same branch connection string credential as the HTTP SQL endpoint is used, but it is supplied via the PostgreSQL startup message inside the wire protocol rather than an HTTP header. The control-plane API key (Bearer token) is not accepted."
source: "https://xata.io/docs/api-reference/gateway/websocket-wire-protocol-proxy"
---

Skip to main content

GET

/

v2

WebSocket wire protocol proxy

```
curl --request GET
  --url https://{branch}.{region}.xata.tech/v2
```

```
import requests

url = "https://{branch}.{region}.xata.tech/v2"

response = requests.get(url)

print(response.text)
```

```
const options = {method: 'GET'};

fetch('https://{branch}.{region}.xata.tech/v2', 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://{branch}.{region}.xata.tech/v2",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
```

```
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://{branch}.{region}.xata.tech/v2"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
```

```
HttpResponse<String> response = Unirest.get("https://{branch}.{region}.xata.tech/v2")
  .asString();
```

```
require 'uri'
require 'net/http'

url = URI("https://{branch}.{region}.xata.tech/v2")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
```

#### Response

Switching Protocols — WebSocket connection established

Was this page helpful?

[Previous](/docs/api-reference/gateway/execute-sql-query)

[Get available regions](/docs/api-reference/projects/get-available-regions)

[Next](/docs/api-reference/projects/get-available-regions)
