Concepts
Connecting to a Session Backend

Connecting to a Session backend with a Connection URL

When making a spawn request via the HTTP API or client library, Jamsocket returns a spawn result that contains a Connection URL. This Connection URL allows you to connect to the server running in your session backend and access endpoints on that server. See the Quickstart for a walkthrough.

This Connection URL comes with an Auth Token that tells Jamsocket which backend to route traffic to. Treat the connection token like a bearer token, because any client that knows it can access the backend.

⚠️

If the Auth Token is not included in the connection URL, the connection to the session backend will fail. See the Troubleshooting page for an example error that occurs when the connection URL is stripped.

Identifying the Connection URL

In Production

In production, a Jamsocket spawn result will include a URL parameter. That URL parameter is the Connection URL.

spawn-result-example
{
  "url": "https://8nyg2.p.jamsocket.net/eqYLfYmVbdIwSukbIxiFJNAjKz8KJLECmfYMQfqSgKs/",
  "name": "8nyg2",
  "ready_url": "https://api.jamsocket.com/ready/8nyg2eqYLfYmVbdIwSukbIxiFJNAjKz8KJLECmfYMQfqSgKs/",
  "status_url":"https://api.jamsocket.com/backend/8nyg2/status",
  "spawned": true,
  "status": "Loading"
}

The basic structure of a Connection URL looks like this:

https://BACKEND_NAME.p.jamsocket.net/AUTH_TOKEN/

In Development with the Dev CLI

When running the Dev CLI, the spawn result values, including the Connection URL, may look a little different because it is running a local version of Jamsocket.

spawn-result-example
{
  "name": "ebb8ljmndix2ge",
  "spawned": true,
  "url": "http://localhost:9090/ClpYXET8OA-ie7ufWFHE5y0Q-NbghE04niQ2fwBZe40/",
  "status_url": "http://localhost:8080/backend/ebb8ljmndix2ge/status",
  "ready_url": "",
  "status": "Loading"
}
Jamsocket is built by Drifting in Space.