Overview of Dev tunnels
maindevtunnel CLI and Visual Studio 2022.repository·main·Indexed 19 days ago
https://github.com/microsoft/dev-tunnelsA service and set of SDKs (Java, Go, Rust, TypeScript/Node.js) that allow developers to securely expose local web services to the internet for remote debugging and testing of web applications and webhooks. It includes a CLI, integration with Visual Studio 2022, and a Node.js contracts library for managing tunnel connections.
devtunnel CLI and Visual Studio 2022.To report bugs or request new features, use the GitHub Issues tracker. Before filing a new issue, search existing issues to ensure your topic has not already been addressed.
For general questions or help regarding the use of Dev Tunnels, contact the team via email.
Before running tests, you must configure the environment with a valid user token and tunnel name.
| Variable | Description |
|---|---|
TEST_TUNNEL_TOKEN | Set to Bearer <token> (get the token via CLI) |
TEST_TUNNEL_NAME | The name of the tunnel to use |
TEST_TUNNEL_VERBOSE | (Optional) Set to 1 to enable verbose console logging |
user show --verbose to retrieve a user token.TEST_TUNNEL_TOKEN using the format Bearer <token> and set TEST_TUNNEL_NAME.mvn test or a specific test case using the -Dtest flag.mvn test -Dtest=TunnelClientTests#connectClientTo develop the Tunnels Java SDK, use VS Code with the following configuration:
java folder in VS Code.M2_HOME and other necessary environment variables are configured.mvn test to verify the setup.mvn testExecute the test suite using npm. You can run the full suite or target specific test cases by matching a substring in the command.
npm run testTo run the getting_started.go example, you must first provision a tunnel and configure the local environment with the necessary identifiers and credentials. Follow these steps:
tunnelId and clusterId from the created tunnel.example.go and place the tunnelId and clusterId into the constants section.getAccessToken() function in example.go.TUNNELS_TOKEN.go run example.goWhen updating the SDK, you must ensure that the package.json files in the connections and management packages require a dependency version strictly greater than the currently published version.
To find the current published version, use:
npm view @microsoft/dev-tunnels-contracts
This prevents dependency mismatches caused by package managers like yarn pulling older versions of packages.
npm view @microsoft/dev-tunnels-contractsTo develop with the Tunnels libraries, ensure you have Node.js version 10.x or above installed. After setting up Node.js, install the necessary dependency packages using npm.
npm installTo release a new version of the Go tunnels package, follow these steps to update the version constant, tag the release in Git, and publish it to the Go package index:
packageVersion constant in tunnels.go to the new version number.git tag v0.0.X (replace X with your version number).git push origin v0.0.X.go list -m github.com/microsoft/dev-tunnels@v0.0.X.# 1. Update packageVersion in tunnels.go
# 2. Tag the version
git tag v0.0.X
# 3. Push the tag
git push origin v0.0.X
# 4. Publish to Go package index
go list -m github.com/microsoft/dev-tunnels@v0.0.XThe Java SDK is published to GitHub Packages using a specific tagging convention. Java packages are identified by tags in the format java-vX.Y.Z.
To publish a new version:
java-vX.Y.Z format (e.g., java-v0.1.27). The version must be higher than the current latest java-* tag.