# RelaySession

One relayed voice connection, from the moment the relay has picked a backend until the connection closes.

Source: https://socketsvc.vercel.app/zh-TW/api/proxy/RelaySession
<Callout title="Generated from source">
  Record `com.socketsvc.proxy.api.RelaySession` — generated from [RelaySession.java](https://github.com/HippoDev03/SocketSVC/blob/main/proxy/common/src/main/java/com/socketsvc/proxy/api/RelaySession.java). Edit the Javadoc in the Java source, then run `pnpm gen:api`.
</Callout>

```java
package com.socketsvc.proxy.api;

public record RelaySession(UUID playerId, String serverName, InetSocketAddress backendAddress, long openedAtNanos) { ... }
```

One relayed voice connection, from the moment the relay has picked a backend until the
connection closes.

**The player id is unverified.** It is whatever the connecting client put in its
`uuid` query parameter, and anyone can put any online player's id there. The relay never
authenticates anybody: the backend does, by the one-time token, after this. Use the id to route
and to report, never as proof that a player is on voice.

## Components

| Component | Description |
| --- | --- |
| `UUID playerId` | the connecting player as the client claims, from its `uuid` query parameter; unverified, see above |
| `String serverName` | the proxy's own name for the chosen backend, or `null` when a [`ProxyBackendResolver`](/api/proxy/ProxyBackendResolver) supplied an address without naming a server |
| `InetSocketAddress backendAddress` | the backend voice listener this connection was piped to |
| `long openedAtNanos` | `System#nanoTime()` when the relay opened; only meaningful as a difference against another `nanoTime()` reading |