Concepts
Spawn and connect

Connecting to a Session Backend

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.

A connection URL looks like this:

https://8nyg2.p.jamsocket.net/eqYLfYmVbdIwSukbIxiFJNAjKz8KJLECmfYMQfqSgKs/"
        \___/                 \_________________________________________/
      backend ID                         connection token

This Connection URL comes with a secret token. Treat the connection token like a bearer token, because any client that knows it can access the backend.

⚠️

If the connection token is not included in a request, the connection will be rejected. See the Troubleshooting page for an example error that occurs when the connection token is stripped from the URL.

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.