1
0
mirror of synced 2026-01-03 15:05:54 -05:00
Files
docs/data/reusables/codespaces/using-tools-to-access-ports-1.md
2023-01-26 16:13:09 +00:00

1.1 KiB

Using command-line tools and REST clients to access ports

When you forward a port, your application becomes available at a URL such as https://USERNAME-CODESPACE-NAME-vrpqrxxrx7x2rxx-4000.preview.app.github.dev. If you forward a private port from the {% data variables.product.prodname_vscode_shortname %} desktop application, your application will also be available at a localhost port such as 127.0.0.1:4000.

To access your application using a REST client, such as Postman, or a command-line tool like curl, you don't need to authenticate if you're using a localhost port, or if you're accessing a public port at the remote domain. However, to connect to a private port at the remote domain, you must authenticate by using the GITHUB_TOKEN access token in your request.

{% note %}

Note: The GITHUB_TOKEN is automatically created when you start a codespace and remains the same for the duration of the codespace session. If you stop and then restart a codespace a new GITHUB_TOKEN is generated.

{% endnote %}