Giter VIP home page Giter VIP logo

dev-tunnels's Introduction

NuGet version npm version

Dev tunnels

Dev tunnels allows developers to securely expose local web services to the Internet, control who has access, and easily & debug your web applications from anywhere. Learn more at Dev tunnels documentation.

SDK Feature Matrix

Feature C# TypeScript Java Go Rust
Management API
Tunnel Client Connections
Tunnel Host Connections
Reconnection
SSH-level Reconnection
Automatic tunnel access token refresh

✅ - Supported
🚧 - In Progress
❌ - Not Supported
🗓️ - Planned

Resources

Documentation

Videos

Official

Community-created

Feedback

Have a question or feedback? There are many ways to submit feedback.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Security

Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include Microsoft, Azure, DotNet, AspNet, Xamarin, and our GitHub organizations.

If you believe you have found a security vulnerability in any Microsoft-owned repository that meets Microsoft's definition of a security vulnerability, please report it to us as described in Security.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

dev-tunnels's People

Contributors

connor4312 avatar dependabot[bot] avatar derekbekoe avatar dmgardiner25 avatar ilyabiryukov avatar jacobroberts avatar jasongin avatar jessetrinity avatar jfullerton44 avatar josebalius avatar joshaber avatar jramsay avatar klvnraju avatar microsoft-github-operations[bot] avatar microsoftopensource avatar neelip avatar setaskin avatar taiyosogawa avatar tanhakabir avatar usanth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dev-tunnels's Issues

Unable to connect to dev tunnel

when trying to connect to dev tunnel, i get an Exception... this happens on several computers.

HTTP: PUT https://euw.rel.tunnels.api.visualstudio.com/tunnels/amusing-pond-pc4n3qt/endpoints/84254436-e1fe-4066-bba7-fe7a41f07947-relay?api-version=2023-09-27-preview&connectionMode=TunnelRelay
HTTP: Authorization: github
HTTP: User-Agent: Dev-Tunnels-Service-CLI/1.0.1160+d54aaf0b07
HTTP: User-Agent: (OS:Microsoft Windows 10.0.19045)
HTTP: User-Agent: Dev-Tunnels-Service-CSharp-SDK/1.1.7+869adcec1c
HTTP: {
"id": "84254436-e1fe-4066-bba7-fe7a41f07947-relay",
"connectionMode": "TunnelRelay",
"hostId": "84254436-e1fe-4066-bba7-fe7a41f07947",
"hostPublicKeys": [
---deleted by me---
]
}
HTTP: DELETE https://euw.rel.tunnels.api.visualstudio.com/tunnels/amusing-pond-pc4n3qt?api-version=2023-09-27-preview
HTTP: Authorization: github
HTTP: User-Agent: Dev-Tunnels-Service-CLI/1.0.1160+d54aaf0b07
HTTP: User-Agent: (OS:Microsoft Windows 10.0.19045)
HTTP: User-Agent: Dev-Tunnels-Service-CSharp-SDK/1.1.7+869adcec1c
Unhandled exception: System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception.
---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid because of errors in the certificate chain: UntrustedRoot
at System.Net.Security.SslStream.SendAuthResetSignal(ProtocolToken , ExceptionDispatchInfo )
at System.Net.Security.SslStream.CompleteHandshake(SslAuthenticationOptions )
at System.Net.Security.SslStream.ForceAuthenticationAsync[TIOAdapter](TIOAdapter , Boolean , Byte[] , Boolean )
at System.Net.Http.ConnectHelper.EstablishSslConnectionAsync(SslClientAuthenticationOptions , HttpRequestMessage , Boolean , Stream , CancellationToken )
--- End of inner exception stack trace ---
at System.Net.Http.ConnectHelper.EstablishSslConnectionAsync(SslClientAuthenticationOptions , HttpRequestMessage , Boolean , Stream , CancellationToken )
at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage , Boolean , CancellationToken )
at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage , Boolean , CancellationToken )
at System.Net.Http.HttpConnectionPool.AddHttp11ConnectionAsync(HttpRequestMessage )
at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellationAsync(CancellationToken )
at System.Net.Http.HttpConnectionPool.GetHttp11ConnectionAsync(HttpRequestMessage , Boolean , CancellationToken )
at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage , Boolean , Boolean , CancellationToken )
at Microsoft.DevTunnels.Cli.Options.TracingHttpHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellation) in /__w/1/s/src/Tunnel/Src/CLI/Options/TracingHttpHandler.cs:line 42
at Microsoft.DevTunnels.Management.FollowRedirectsHttpHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellation)
at System.Net.Http.HttpClient.g__Core|83_0(HttpRequestMessage , HttpCompletionOption , CancellationTokenSource , Boolean , CancellationTokenSource , CancellationToken )
at Microsoft.DevTunnels.Management.TunnelManagementClient.SendRequestAsync[TRequest,TResult](HttpMethod method, Uri uri, TunnelRequestOptions options, AuthenticationHeaderValue authHeader, TRequest body, CancellationToken cancellation)
at Microsoft.DevTunnels.Management.TunnelManagementClient.SendTunnelRequestAsync[TRequest,TResult](HttpMethod method, Tunnel tunnel, String[] accessTokenScopes, String path, String query, TunnelRequestOptions options, TRequest body, CancellationToken cancellation, Boolean isCreate)
at Microsoft.DevTunnels.Management.TunnelManagementClient.DeleteTunnelAsync(Tunnel tunnel, TunnelRequestOptions options, CancellationToken cancellation)
at Microsoft.DevTunnels.Cli.Commands.HostCommand.HostAsync(UInt16[] portNumbers, String protocol, String sshUser, TunnelCommandOptions options, CancellationToken cancellation) in /__w/1/s/src/Tunnel/Src/CLI/Commands/HostCommand.cs:line 434

devtunnel CLI: Add support for linux arm32

I would like to host/test a dotnet asp api on my raspberry Pi. But it seems devtunnel cli doesnot work on it.

steps:

  1. run the following command on Pi4 accoordind to the instructions on link
curl -sL https://aka.ms/DevTunnelCliInstall | bash
  1. Here is the output of installation command
Downloading the devtunnel CLI...
Selecting previously unselected package libsecret-common.
(Reading database ... 45756 files and directories currently installed.)
Preparing to unpack .../libsecret-common_0.20.4-2_all.deb ...
Unpacking libsecret-common (0.20.4-2) ...
Selecting previously unselected package libsecret-1-0:armhf.
Preparing to unpack .../libsecret-1-0_0.20.4-2_armhf.deb ...
Unpacking libsecret-1-0:armhf (0.20.4-2) ...
Setting up libsecret-common (0.20.4-2) ...
Setting up libsecret-1-0:armhf (0.20.4-2) ...
Processing triggers for libc-bin (2.31-13+rpt2+rpi1+deb11u5) ...
devtunnel CLI installed!

Version:
bash: line 71: /root/bin/devtunnel: No such file or directory
    

To get started, run:
    source ~/.bashrc
    devtunnel -h
  1. after source import the bashrc and run devtunnel, even I reboot the device, this devtunnel cli tool always report
-bash: /root/bin/devtunnel: No such file or directory

environment

  • raspberry Pi 4B with 4G ram
  • 2023-05-03-raspios-bullseye-armhf-lite.img installed

What this library is for?

This library looks very interesting, but there is no any description about the prupose of it. Is it somehow connected with VSCode Remote extensions?

Request to increase Max Bandwidth

Hi,
I am developing Teams Platform apps with SSO in place. I need to deploy these in local for faster evaluation and register these urls in Azure portal.

I rely on devtunnel's fixed url to save myself from updating the azure portal app registration.

I think I have run out of my quota. I need another 6 GB quota.

Kindly update the max bandwidth.

How to inspect traffic for a running tunnel?

This tool is positioned as a replacement for ngrok. One very useful feature of ngrok is the ability to view the request/response on a currently running tunnel.

I can't figure out how to do this with this tool, either through the browser (like ngrok) or via the CLI.

I can see an active tunnel...

devtunnel show <tunnel-id>

But when I connect to it, it just outputs a stream of "opened" ports and never shows any data on them...

devtunnel connect <tunnel-id>

Is it possible to get a debug view of the traffic without using another tool?

Support HTTP/2 on devtunnels.ms

I started a gRPC server on ASP.NET Core and then tried to access it from a client through Dev Tunnels.

The client throws the following exception:

Grpc.Core.RpcException: 'Status(StatusCode="Internal", Detail="Error starting gRPC call. HttpRequestException: Requesting HTTP version 2.0 with version policy RequestVersionOrHigher while unable to establish HTTP/2 connection.", DebugException="System.Net.Http.HttpRequestException: Requesting HTTP version 2.0 with version policy RequestVersionOrHigher while unable to establish HTTP/2 connection.")'

The tunnel appears to downgrade HTTP requests, is it not compatible with HTTP/2?

Persistent Dev Tunnel Stops Responding

I've been trying out Dev Tunnels as a replacement for ngrok but I've run into a problem that persistent tunnels work fine for hours but stop responding after a while. I'm not sure what triggers this, it could be a hibernate/resume on my dev machine, could be that the tunnel is idle overnight, might be something else altogether. The current tunnel I'm trying is at https://zllwmpxn-7190.usw3.devtunnels.ms/, the simplest way to test is just browse to it but if I do that it times out. The DNS entry looks ok:

C:\>nslookup zllwmpxn-7190.usw3.devtunnels.ms
Server:  Linksys05100
Address:  192.168.7.1

Non-authoritative answer:
Name:    tunnels-prod-rel-usw3-v3-cluster.westus3.cloudapp.azure.com
Address:  20.125.70.28
Aliases:  zllwmpxn-7190.usw3.devtunnels.ms
          tunnels-prod-rel-usw3-live-tm.trafficmanager.net
          v3-usw3.cluster.rel.tunnels.api.visualstudio.com

The tunnel inspection URI works but shows no traffic. It's a public persistent tunnel (see image), but for security I'll recreate it once this problem is resolved.

devtunnel

The tunnel was created using Visual Studio and I am new to this so I may be missing something obvious.

devtunnel rewrites Origin request header to localhost

I am running into CORS issues when connecting from a browser to a local REST API through devtunnel.
The reason seems to be that devtunnel rewrites the Origin request header to http://localhost:nnnn in some cases.

To reproduce, consider a PHP web application that returns the Origin request header:

<?php
# file index.php
echo "Origin:" . (print_r($_SERVER['HTTP_ORIGIN'], true)) . "\n";

If I run this locally using PHP's built-in web server:

php -S 0:8080 index.php

I can use curl to inspect the Origin header received:

$ curl http://localhost:8080 -H'Origin: http://whatever.example.com'
Origin:http://whatever.example.com

If I start a devtunnel and use that, it works similarly:

$ curl https://abcd1234.euw.devtunnels.ms:8080 -H'Origin: http://whatever.example.com'
Origin:http://whatever.example.com

But if I use an origin for the devtunnel host on a different port, the Origin suddenly gets rewritten to localhost:

$ curl https://abcd1234.euw.devtunnels.ms:8080 -H'Origin: https://abcd1234.euw.devtunnels.ms:8081'
Origin:http://localhost:8080

This is causing CORS issue when I have a frontend and a backend application using the same devtunnel hostname with different ports.

Support custom names

I apologize in advance as this is most likely the wrong place to request this feature, but I could not find a better place for it.

It would be great to have the ability to reserve a permanent host name, especially one that is slightly friendlier when we have to tell it to somebody over the phone or type it in on a mobile device. Because of the multi-region support, this might not be possible. But I would think in most cases we'd get good enough results since I don't normally move around geographically much when testing stuff via dev tunnels.

The general reasoning is that while the 30-day persisted name is very helpful, it's not uncommon for us to work with external services (for example mailgun) in our testing. We don't need the tunnel to test with these services very often, but it's still a pain to go in and reconfigure the service for a new URL if it has been more than 30 days since we last used the tunnel. This is especially true when it's a shared service that multiple developers use. Each developer has to reconfigure the service to point to their instance instead of spinning up a tunnel with a common name available to all developers.

Bonus points would be if we could reserve an entire prefix for our name/organization.

https://<reserved-name>.usw3.devtunnels.ms
https://*.<reserved-name>.usw3.devtunnels.ms

I would be fine if reserved-name was something that was still assigned to use. Since we have to sign in to our MS account, if it was either our e-mail/login name or org name, that would suffice so that we can't just start gobbling up easy to type names. So:

https://user_domain_org.usw3.devtunnels.ms
https://*.org-name.usw3.devtunnels.ms

Rust devtunnels client can no longer parse TunnelEndpoints

@jfullerton44 in this change, the ID for the tunnel endpoint became mandatory

https://github.com/microsoft/dev-tunnels/blame/c85e0671d98dd25331149959af6e4adf67dfb2b8/cs/src/Contracts/TunnelEndpoint.cs#L31

However, it seems like the Dev Tunnels service does not actually return that as a non-nullable string. For example, this is my tunnel in production

  "endpoints": [
    {
      "hostRelayUri": "wss://usw2-data.rel.tunnels.api.visualstudio.com/api/v1/Host/Connect/29034sjz",
      "clientRelayUri": "wss://usw2-data.rel.tunnels.api.visualstudio.com/api/v1/Client/Connect/29034sjz",
      "id": null,
      "connectionMode": "TunnelRelay",
      "hostId": "706f244f-a4d3-422c-a8a4-f8dc272cb7e5",
      "portUriFormat": "https://29034sjz-{port}.usw2.devtunnels.ms/",
      "tunnelUri": "https://29034sjz.usw2.devtunnels.ms/",
      "portSshCommandFormat": "ssh 29034sjz-{port}@ssh.usw2.devtunnels.ms",
      "tunnelSshCommand": "ssh [email protected]"
    }
  ],

So, trying to parse that in Rust gives invalid type: null.

The generator uses the presence of the [JsonIgnore(...)] attribute to determine if a field should be nullable. Should that be applied to the ID?

When creating a dev tunnel from visual studio certificate seems invalid

Failed to create dev tunnel 'mytesttunnel': Creating the dev tunnel failed. The SSL connection could not be established, see inner exception. The remote certificate is invalid according to the validation procedure: RemoteCertificateNameMismatch

VS version: Version 17.6.4

Also tried to do the same via cli:
https://learn.microsoft.com/en-us/azure/developer/dev-tunnels/get-started?tabs=windows

.\devtunnel.exe list --verbose
The SSL connection could not be established, see inner exception.

It seems: https://global.rel.tunnels.api.visualstudio.com/tunnels?includePorts=true&global=true&api-version=2023-05-23-preview&ownedTunnelsOnly=true

has a certificate issue?

See output:

MSAL: TokenEndpoint: ****
HTTP: GET https://global.rel.tunnels.api.visualstudio.com/tunnels?includePorts=true&global=true&api-version=2023-05-23-preview&ownedTunnelsOnly=true
HTTP: Authorization: Bearer <token>
HTTP: User-Agent: Dev-Tunnels-Service-CLI/1.0.964+9595af4514
HTTP: User-Agent: Dev-Tunnels-Service-CSharp-SDK/1.0.7453+26a92598d1
Unhandled exception: System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception.
 ---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure: RemoteCertificateNameMismatch
   at System.Net.Security.SslStream.SendAuthResetSignal(ProtocolToken , ExceptionDispatchInfo )
   at System.Net.Security.SslStream.CompleteHandshake(SslAuthenticationOptions )
   at System.Net.Security.SslStream.ForceAuthenticationAsync[TIOAdapter](TIOAdapter , Boolean , Byte[] , Boolean )
   at System.Net.Http.ConnectHelper.EstablishSslConnectionAsync(SslClientAuthenticationOptions , HttpRequestMessage , Boolean , Stream , CancellationToken )
   --- End of inner exception stack trace ---
   at System.Net.Http.ConnectHelper.EstablishSslConnectionAsync(SslClientAuthenticationOptions , HttpRequestMessage , Boolean , Stream , CancellationToken )
   at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage , Boolean , CancellationToken )
   at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage , Boolean , CancellationToken )
   at System.Net.Http.HttpConnectionPool.AddHttp11ConnectionAsync(HttpRequestMessage )
   at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellationAsync(CancellationToken )
   at System.Net.Http.HttpConnectionPool.GetHttp11ConnectionAsync(HttpRequestMessage , Boolean , CancellationToken )
   at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage , Boolean , Boolean , CancellationToken )
   at Microsoft.DevTunnels.Cli.Options.TracingHttpHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellation) in /__w/1/s/src/Tunnel/Src/CLI/Options/TracingHttpHandler.cs:line 42
   at Microsoft.DevTunnels.Management.FollowRedirectsHttpHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellation)
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage , HttpCompletionOption , CancellationTokenSource , Boolean , CancellationTokenSource , CancellationToken )
   at Microsoft.DevTunnels.Management.TunnelManagementClient.SendRequestAsync[TRequest,TResult](HttpMethod method, Uri uri, TunnelRequestOptions options, AuthenticationHeaderValue authHeader, TRequest body, CancellationToken cancellation)
   at Microsoft.DevTunnels.Management.TunnelManagementClient.SendRequestAsync[TRequest,TResult](HttpMethod method, String clusterId, String path, String query, TunnelRequestOptions options, TRequest body, CancellationToken cancellation)
   at Microsoft.DevTunnels.Management.TunnelManagementClient.ListTunnelsAsync(String clusterId, String domain, TunnelRequestOptions options, Nullable`1 ownedTunnelsOnly, CancellationToken cancellation)
   at Microsoft.DevTunnels.Cli.Commands.CommandUtils.GetUserTunnelsAsync(CommonOptions options, IUserManager userManager, TunnelRequestOptions requestOptions, CancellationToken cancellation) in /__w/1/s/src/Tunnel/Src/CLI/Commands/CommandUtils.cs:line 136
   at Microsoft.DevTunnels.Cli.Commands.TunnelCommands.ListAsync(String[] tags, String[] allTags, Nullable`1 limit, CommonOptions options, CancellationToken cancellation) in /__w/1/s/src/Tunnel/Src/CLI/Commands/TunnelCommands.cs:line 216

image

requesting increase `Max web-forwarding HTTP request body size` and `Bandwidth`

I'm developing Web UI to inference video/image based on trained Deep Learning. So the web app is using resource that related with bandwidth, transfer rate, request body size.
I need to grading the dev tunnellimitation with this specification:

Resource Limit Reason
Bandwidth 60 GB per user (upgrade) Since many clients will hit my web, I need to upgrade it.
Tunnels 2 per user (downgrade) I actually just need one, the other one is just reserved purpose, so can downgrade it
Active connections 20 per port (default) I have no idea, so I keep it default, it seems related with TCP connection keep alive
Ports 2 per tunnel (downgrade) Same as tunnels reason
HTTP request rate 6000/min per port (upgrade) I have many PUT requests from client to update inference progress of video/image
Data transfer rate Up to 40 MB/s per tunnel (upgrade) My local server network has 100Mbps setup
Max web-forwarding HTTP request body size 128 MB (upgrade) Many videos to upload has size about it

Client cannot make API calls when running in Dev Tunnel

I'm trying to use Dev Tunnels with my Blazor .NET client application. I also have a REST API project (.NET 7) that the client utilizes.
The API is hosted in Azure, but I cannot get the client to make successful API requests when the client is running in a Dev Tunnel.
In Fiddler, I see the client making HTTP OPTIONS /protected/Provider HTTP/1.1 requests, but no other HTTP verbs are used in any requests.

I updated the CORS settings for the API to include the client dev tunnel URL (the actual settings file does not have any x 'd-out data).
"CorsPolicySettings": {
"Origins": [
"https://localhost:7094",
"https://xxxxxxxx-7094.use2.devtunnels.ms/"
]
},

What am I missing?

I set up a dev tunnel for the API running locally on my machine, and I can connect to it with the client just fine when the client is not using a dev tunnel. But when I switch the client to a dev tunnel, I have the same issue where no API requests are made - just the HTTP OPTIONS.

Here is an example header from an HTTP request:

Request URL:
https://xxxxxxxxxxxxxxxxxx.azurewebsites.net/protected/Provider
Request Method: OPTIONS
Status Code: 204 No Content
Remote Address: 127.0.0.1:8888
Referrer Policy: same-origin

Include port forwarding URIs in "devtunnel show" even when not hosting

With latest version the url is not print anymore after the port in devtunnel show output and with the new human readable id, the url does not seems to match the new id.

I need to know this info before running withtou running devtunnel host the tunnel is active in another terminal and I cannot run the commande or it will kill it.

Is the new id style also bind to a url ? Is it safe to depend on it now ? or could you just display the url again in the devtunnel show

devtunnel host crash with `Value cannot be null. (Parameter 'id')`

When trying to start my tunnel today, with devtunnel host I'm getting the following error:

Unhandled exception: System.ArgumentNullException: Value cannot be null. (Parameter 'id')
   at Microsoft.Requires.NotNullOrEmpty(String value, String parameterName)
   at Microsoft.DevTunnels.Management.TunnelManagementClient.DeleteTunnelEndpointsAsync(Tunnel tunnel, String id, TunnelRequestOptions options, CancellationToken cancellation)
   at Microsoft.DevTunnels.Cli.Commands.HostCommand.HostAsync(UInt16[] portNumbers, String protocol, String sshUser, TunnelCommandOptions options, CancellationToken cancellation) in /__w/1/s/src/Tunnel/Src/CLI/Commands/HostCommand.cs:line 267
devtunnel show 
Tunnel ID             : xxxxxx
Name                  : 
Description           : 
Labels                : some-label
Access control        : {+Anonymous [connect]}
Host connections      : 0
Client connections    : 0
Current upload rate   : 0 MB/s (limit: 20 MB/s)
Current download rate : 0 MB/s (limit: 20 MB/s)
Upload total          : 16 MB
Download total        : 226 MB
Ports                 : 1
  8084  auto  https://xxxxxx-8084.use.devtunnels.ms/  
Tunnel Expiration     : 28.7 days

devtunnel version

Tunnel CLI version: 1.0.1042+788c4fbe73

Tunnel service URI        : https://global.rel.tunnels.api.visualstudio.com/
Tunnel service version    : 1.0.1046.58452 (54e4c4e036; 2023-11-22 23:50:22Z)
Tunnel service cluster    : use

Allow self hosting dev tunnels server

Dev tunnels is a great feature, however it would be great if I was able to host the forwarding service on-site for those who need the additional security. Especially now that vscode server has removed the option to serve-local

HTTP 301 returned when using any command

I'm getting HTTP response code 301 for any operation, including listing tunnels, creating new tunnel, etc.
Same thing happens in Visual Studio.
image

I'm trying it on company PC, which has ZScaler proxy. Maybe it breaks it.
Shouldn't this tool follow address provided in response Location header?

Organization controls for Dev Tunnels

We have developers starting to use these tunnels, we see this as a threat to our security. What we'd like to know is whether we have a way to:

(1) Prevent developers from using the unsafe options for the tunnel, like public and permanent
(2) Enforce that developers use the safe options for the tunnel, like private and temporary
 

Is there a central place where we can configure (1) and/or (2) in our ADO or GitHub tenants ? If we cannot do (1) and (2), what other controls do we have to secure this from a central point in an organization?

Thanks

Why does dev-tunnels lower the header names ?

While I was debbuing an application that calculate hash using the header name I discovered that dev-tunnels lowers the header name, an curl example:

curl --location 'https://host.devtunnels.ms/v1/actions/azdo-build-validation:add' \
--header 'X-OpsLevel-Timing: 1709083272' \
--header 'X-OpsLevel-Signature: sha256=347df57a124347c6db9c4117401763d4e6df61396623faf8c5c8a14f5c3984bd' \
--header 'Content-Type: application/json' \
--data '{
  "service": "pla-opslevel-integration-api",
  "repository": "hidrovias/pla-sln-opslevel-integration"
}'

And the log output using HttpLogginMiddleware(ASPNET CORE):

info: Microsoft.AspNetCore.HttpLogging.HttpLoggingMiddleware[9]
      Request and Response:
      Protocol: HTTP/2
      Method: POST
      Scheme: https
      PathBase:
      Path: /v1/actions/azdo-build-validation:add
      Accept: */*
      Host: localhost:5011
      User-Agent: Faraday v1.10.3
      Accept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3
      baggage: [Redacted]
      Content-Type: application/json
      traceparent: [Redacted]
      tracestate: [Redacted]
      Content-Length: 105
      x-request-id: [Redacted]
      x-real-ip: [Redacted]
      x-forwarded-proto: [Redacted]
      x-forwarded-host: [Redacted]
      x-forwarded-port: [Redacted]
      x-forwarded-scheme: [Redacted]
      x-original-uri: [Redacted]
      x-scheme: [Redacted]
      x-opslevel-timing: 1709085444
      x-opslevel-signature: sha256=32c77d5c0ee8bc84dcfae71838c5c7eb1fe17a8f3d3c5d6307d072460ba4c614
      x-datadog-trace-id: [Redacted]
      x-datadog-parent-id: [Redacted]
      x-datadog-sampling-priority: [Redacted]
      x-datadog-tags: [Redacted]
      sentry-trace: [Redacted]
      x-original-proto: [Redacted]
      x-forwarded-for: [Redacted]
      StatusCode: 401
      Content-Type: text/plain
      RequestBody: {
  "service": "pla-opslevel-integration-api",
  "repository": "hidrovias/pla-sln-opslevel-integration"
}
      RequestBodyStatus: [Completed]
      Duration: 59592,9107

using the configuration:

        builder.Services.AddHttpLogging(logging =>
        {
            logging.LoggingFields = HttpLoggingFields.RequestPropertiesAndHeaders | HttpLoggingFields.ResponsePropertiesAndHeaders | HttpLoggingFields.RequestBody | HttpLoggingFields.Duration;
            logging.RequestHeaders.Add("X-OpsLevel-Signature");
            logging.RequestHeaders.Add("X-OpsLevel-Timing");
        });

Is this the expected behaviour ?

Bandwidth increase request

I am currently working as an AI Researcher at Khyber Medical University. To connect to my workstation, I use Devtunnel. However, I have run out of my data limit. My account is linked with Microsoft via the email [email protected].

I kindly request an increase in my bandwidth to 10 GB.

Tasks

No tasks being tracked yet.

Tasks

Cannot access https server via tunnel

I am running an HTTPS service locally, which I can access successfully on https://localhost:6001 (using Postman). If I expose this service via a tunnel and then try to access it via the tunnel URL (e.g. https://abcdefgh-6001.euw.devtunnels.ms), the connection fails with a 502 Bad Gateway and the server reports "Failed to authenticate HTTPS connection." and "Cannot determine the frame size or a corrupted frame was received.".

If I run the diagnostic server (devtunnel echo http -p 6001) the connection via the tunnel works just fine.

Do you have any idea what the problem may be? What might I do to investigate this further?

Using anonymous access devtunnel for accessing http api - authorization header sent from client is dropped

From within a vscode extension I issue the follwoing node-fetch request:

fetch("http://tunnel-address:80/path1/path2", {
headers: {
authorization: Bearer ${token},
accept: 'application/json'
}
});
(where "token" holds a valid token received from my api's login request.

I output all headers on server side and authorization header does not reach server.

When accessing directly without the tunnel, (i.e. url is http://localhost:9000/path1/path2) the authorization header IS recevied on the server side.

Websocket over devtunnel is not working

I am trying to connect a websocket over the devtunnel but the connection is not fully established.
I am trying using the wss:// protocol over the https:// endpoint.

Are websockets currently supported?

Support forwarding HTTPS client certificates

I was trying to debug a Certificate Authentication issue using Tunneling.

Basically I have an Azure APIM, where I am doing a [send-request] (https://learn.microsoft.com/en-us/azure/api-management/send-request-policy) with authentication-certificate The request URL is my tunneled ASP.NET Core Web API running locally.

It looks like the certificate is not getting forwarded in: No client certificate found.

[21:42:59 INF] Request starting HTTP/2 GET https://localhost:7097/api/v1/Tenants/GetTenantByClientId?clientId=69fffd25-cd92-4db6-9a72-852e9cfbb7a0 - -
[21:42:59 DBG] No Content-Type header for request body.
[21:42:59 INF] Request:
Protocol: HTTP/2
Method: GET
Scheme: https
PathBase:
Path: /api/v1/Tenants/GetTenantByClientId
Host: localhost:7097
traceparent: [Redacted]
x-request-id: [Redacted]
x-real-ip: [Redacted]
x-forwarded-host: [Redacted]
x-forwarded-port: [Redacted]
x-forwarded-scheme: [Redacted]
x-original-uri: [Redacted]
x-scheme: [Redacted]
x-original-proto: [Redacted]
X-Original-For: [Redacted]
[21:42:59 DBG] 2 candidate(s) found for the request path '/api/v1/Tenants/GetTenantByClientId'
[21:42:59 DBG] Endpoint '[Redacted]TenantsController.GetTenantByClientId ([Redacted])' with route pattern 'api/v{version:apiVersion}/Tenants/GetTenantByClientId' is valid for the request path '/api/v1/Tenants/GetTenantByClientId'
[21:42:59 DBG] Endpoint '[Redacted]TenantsController.GetTenantByTenantCode ([Redacted])' with route pattern 'api/v{version:apiVersion}/Tenants/{tenantCode}' is valid for the request path '/api/v1/Tenants/GetTenantByClientId'
[21:42:59 DBG] Request matched endpoint '[Redacted]TenantsController.GetTenantByClientId ([Redacted])'
[21:42:59 DBG] Static files was skipped as the request already matched an endpoint.
[21:42:59 DBG] No client certificate found.
[21:42:59 DBG] AuthenticationScheme: Certificate was not authenticated.
[21:43:00 DBG] AuthenticationScheme: Certificate was not authenticated.
[21:43:00 INF] Authorization failed. These requirements were not met:
DenyAnonymousAuthorizationRequirement: Requires an authenticated user.
[21:43:00 INF] AuthenticationScheme: Bearer was challenged.
[21:43:00 INF] AuthenticationScheme: Certificate was challenged.
[21:43:00 INF] Response:
StatusCode: 403
WWW-Authenticate: [Redacted]
[21:43:00 INF] Request finished HTTP/2 GET https://localhost:7097/api/v1/Tenants/GetTenantByClientId?clientId=69fffd25-cd92-4db6-9a72-852e9cfbb7a0 - - - 403 0 - 1363.3172ms

And when the code is deployed to Azure, it's working fine: #51819

Support Dart client (Flutter)

When i access dev tunnels api via flutter every 3 sec once the api call taking time there is no response like http status code or response body

Expiration

is it possible to set the expiration date for a dev tunnel id

Rust SDK logs lots of noisy errors if no policy is in place in registry

Currently the dev tunnels SDK logs an error if the registry key that sets policies doesn't exist on every outgoing HTTP request. This shouldn't happen: the lack of a policy is an expected state for the majority of users, I would expect a ~debug level log on client creation if the policy wasn't found, but not an error, and not on every request

[2024-01-29 14:27:05] debug Starting tunnel with `code-oss target\debug\code.exe --verbose tunnel`       
[2024-01-29 14:27:06] trace wsl availability detected via lxss
[2024-01-29 14:27:07] debug Starting tunnel to server...
user agent "vscode-server-launcher/1.87.0 Dev-Tunnels-Service-Rust-SDK/0.1.0 (OS: Windows 10.0.22621)"
[2024-01-29 14:27:07] error [tunnels::management::http_client] Failed to get policy header value: The system cannot find the file specified. (os error 2)
[2024-01-29 14:27:07] trace Found token in keyring
[2024-01-29 14:27:07] error [tunnels::management::http_client] Failed to get policy header value: The system cannot find the file specified. (os error 2)
[2024-01-29 14:27:07] trace Found token in keyring

CORS issue when connecting to DevTunnel

I currently have a scenario where I'm running into an issue with CORS when I try to connect from one dev tunnel to another.
In my scenario I'm hosting an Angular application on devtunnel1.devtunnels.ms and my ASP.NET Core backend on devtunnel2.devtunnels.ms. I would like to communicate my Angular application (hosted on devtunnel1) to communicate with my backend hosted on devtunnel2.

Since the HTTP requests are performed by the browser, CORS is checked an I'm receiving an error of the following kind:

Access to XMLHttpRequest at 'https://devtunnel1.devtunnels.ms' from origin 'https://devtunnel2.devtunnels.ms' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

I should mention that the request itself is routed successfully to my backend on devtunnel2, since the response code is a 200 and I also see the request coming through. The response is blocked from the browser due to the mentioned CORS error.

Did I configure something wrong or is this scenario not supported yet?

Edit and Resend Issues

I've seen two problems so far

  1. Sometimes it simply does not work, the Network Console window opens up but attempting to resend from it fails and from then on if you close the window and try again it shows no data.
  2. If it is working resending a message picks up a lot of new headers (presumably from the page context). This is not helpful if you're just trying to resend the original message.

Allow IT policy control of authentication methods

My IT department would like to see a way to block access to authentication methods other than our Microsoft AD domain before they let me use this functionality. Could I request a policy setting to turn off GitHub authentication?

devtunnel login fails with 403 on the localhost callback

The console then keeps waiting.

Tunnel CLI version: 1.0.791+d10ee4be43

Tunnel service URI        : https://global.rel.tunnels.api.visualstudio.com/
Tunnel service version    : 1.0.944.532 (14026cffe3; 2023-10-04 01:45:30Z)
Tunnel service cluster    : usw2

Offset error when trying to start when logged in via GitHub

Hey team,

I thought I'd try and give the CLI version a spin.

devtunnel host -p 5200

The UTC time represented when the offset is applied must be between year 0 and 10,000. (Parameter 'offset')

This appears to be an issue when authenticated via GitHub.

Unhandled exception: System.ArgumentOutOfRangeException: The UTC time represented when the offset is applied must be between year 0 and 10,000. (Parameter 'offset')
   at System.DateTimeOffset.ValidateDate(DateTime dateTime, TimeSpan offset)
   at System.DateTimeOffset..ctor(DateTime dateTime)
   at System.DateTimeOffset.op_Implicit(DateTime dateTime)
   at Microsoft.DevTunnels.Cli.Authentication.GitHubApp.AcquireTokenSilentAsync(String[] scopes, IAccount account, CancellationToken cancellation) in /Users/runner/work/1/s/src/Tunnel/Src/CLI/Authentication/GitHubApp.cs:line 125
   at Microsoft.DevTunnels.Cli.Authentication.UserManager.GetCurrentUserAsync(CommonOptions options, CancellationToken cancellation) in /Users/runner/work/1/s/src/Tunnel/Src/CLI/Authentication/UserManager.cs:line 70
   at Microsoft.DevTunnels.Cli.Commands.HostCommand.HostAsync(UInt16[] portNumbers, String protocol, String sshUser, TunnelCommandOptions options, CancellationToken cancellation) in /Users/runner/work/1/s/src/Tunnel/Src/CLI/Commands/HostCommand.cs:line 106

Unexpected error during devtunnel login on Windows

I have yet to be able to login. Always get this error and then PowerShell freezes up:

Unknown Status: Unexpected
Error 0xffffffff80070520
Context: Unexpected exception while waiting for accounts control to finish: '(pii)'
Tag: 0x1f7d734b (error code -2147023584) (internal error code 528315211)

Provide the API version for TS' HttpTunnelManagementClient as an enumeration

The valid versions of the apiVersion passed into the HttpTunnelManagementClient are checked at runtime and an error is thrown if invalid

if (apiVersions.indexOf(apiVersion) === -1) {
throw new TypeError(`Invalid API version: ${apiVersion}, must be one of ${apiVersions}`);
}

It would be less error-prone if API vesions were exposed as a type (e.g. an enum or union of string types) so that they can be checked at compile-time.

This led to some confusion in https://github.com/microsoft/vscode-remote-tunnels/pull/709#discussion_r1416362126

Support non-debian based linux distros in install script

I tried to follow the installation instructions from Microsoft Learn on Fedora Linux:

curl -sL https://aka.ms/DevTunnelCliInstall | bash

but the script fails with the error

sudo: apt-get: command not found

From what I can see, the install script only uses apt-get for installing the libsecret dependency, not for installing dev-tunnels itself.
I understand its a hassle to support all kinds of package managers on all kinds of distributions, but perhaps this script could be updated to check if apt-get is available, and if not the print a warning that dependencies must be installed manually?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.