Coder Social home page Coder Social logo

microsoft-teams-tunnelrelay's Introduction

Tunnel Relay

Tunnel relay allows you to expose local services to the outside world over HTTPS using Azure Relay.

Tunnel Relay Logo

Overview

Since most developers don't have static IP addresses for their development machines visible to the external world, it is incredibly cumbersome for them to develop and test services. Tunnel Relay is a free and open-source tool that provides you a static URL for your local service which can be accessed externally!

Overview

Download

Latest release can be downloaded here.
You can also access the latest nuget packages for extending Tunnel Relay at https://www.myget.org/F/tunnelrelay/api/v3/index.json

Requirements

Supported Operation Systems

Tunnel Relay is written on top of .Net Core 3.1. Thus the minimum OS requirements are same as .Net Core 3.1. You can check these requirements here

Microsoft Azure

Tunnel Relay uses Azure Relays so you need a Microsoft Azure Subscription. You can sign up for a free trial here

Get Started

Tunnel Relay supports 2 variants. GUI and CUI based. GUI is only supported in Windows, while CUI is supported in all 3 supported OSes (Windows, Linux and OSX).

Both of these will guide the user through the setup process. All settings are stored in appSettings.json in the executable directory. You can delete this file at anytime to reset and start over.

Following image explains the basic components of the app when GUI mode is being used. User needs to login before they can start using the app. This is covered in Configuration. Main Window

FAQs

Q. How is Tunnel Relay v2 different from Tunnel Relay v1?
A. Tunnel Relay v2 adds support for Linux and Mac Operation systems. To achieve this, it uses Hybrid Connections. This also means that the Relays of v1 cannot be reused in v2. Additionally v2 adds support for commandline.

Q. Do my clients need to change to understand that they are contacting server over Tunnel Relay vs directly?
A. Short answer no. All your clients need to see is the url exposed by Tunnel Relay. Rest everything remains the same.

Q. Can I share same Relay namespace across multiple machines?
A. Yes, you can share same Azure Relay namespace across multiple machines. Each relay is a unique combination of Azure Relay and machine name.

Q. How much will this cost me?
A. Tunnel Relay itself is a free, open-source tool, you will have to pay for the Azure Relay itself. Pricing for Azure Relay can be found here. Please look for section Hybrid connections and Windows Communication Foundation (WCF) relays to get the pricing information.

Q. I have an issue which needs your attention how can I contact you?
A. We monitor this Github repo for issues. Please open a new issue or reply to an existing one. We will get back to you soon.

Q. I want to extend Tunnel Relay. How can I do so?
A. Tunnel Relay is released under MIT License. Please look at the contributing section below if you want to contribute to this project.

Understand how Tunnel Relay works

Please refer to following articles to learn more about Tunnel Relay and its internal workings

  1. Configuration
  2. Request Handling
  3. Internal Design
  4. Extending Tunnel Relay - Plugins
  5. Advanced Functionality

Issues, problems, feedback, questions?

Please report them here

Contributing

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.

microsoft-teams-tunnelrelay's People

Contributors

devjha-ms avatar microsoft-github-policy-service[bot] avatar microsoftopensource avatar msftgits avatar nokafor avatar o365devx avatar ramjotsingh 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

Watchers

 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

microsoft-teams-tunnelrelay's Issues

"FAILED TO START AZURE PROXY!!!!" error message

When I start Tunnel Relay in a remote desktop, the message "FAILED TO START AZURE PROXY!!!!" is displayed in the first input field:

error

No debug information is given. What can I do to diagnose this problem?

Create a new Azure Relay fails

When Creating a new Relay on Azure, the creation fails, probably because there is no way to select a Resource Group for Azure Relay in the UI.
image

Not working with root javascript references

Hi Team;

I tried to use the Tunnel relay with an Angular 5 application, because of the sub folder of the tunnel redirection.
For instance, here is my config:
http://localhost:4200 redirect to https://msteams.servicebus.windows.net/MY-MACHINE-NAME/

As expected, it works for the root homepage, but this homepage is referencing javascript files:

<!doctype html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <title>Teamsng5</title>
  <base href="/">

   <meta name="viewport" content="width=device-width, initial-scale=1">
   <link rel="icon" type="image/x-icon" href="favicon.ico">
</head>

<body class="theme-light">
  <div class="surface">
    <div class="panel">
      <app-root></app-root>
    </div>
  </div>


 <script src="https://statics.teams.microsoft.com/sdk/v1.0/js/MicrosoftTeams.js"></script>
<script type="text/javascript" src="inline.bundle.js"></script>
<script type="text/javascript" src="polyfills.bundle.js"></script>
<script type="text/javascript" src="styles.bundle.js"></script>
<script type="text/javascript" src="vendor.bundle.js"></script>
<script type="text/javascript" src="main.bundle.js"></script>

</body>

</html>

What happened is that the url invoked for each script is something like https://msteams.servicebus.windows.net/inline.bundle.js

And obviously it doesn't work at all.

Do you have any idea on how to proceed ?

Thx

Not an issue, a question

Hi! I'm hoping to use this at least as a short term workaround as a way to sideload a bot into teams for which we can't have a public url. Question: is there a way to start TunnelRelay automatically with exported settings? So that I could deploy it as part of a service, and it would automatically start and be listening/redirecting?

Thanks.

Crash on Ubuntu 18.04

First, project seems awesome from documentation! Keep the good work :)

I've downloaded the linux 64 version of release V2 from here and was trying to run this on a clean Ubuntu 18.04 VM machine.

almog@ubuntu:~/tunnel_relay$ sudo ./TunnelRelay.Console-linux-x64/TunnelRelay.Console
[sudo] password for almog:
Please wait while we log you in...
Interactive login required. Please enter BR5DKKXAX when asked for in the browser window. If a browser windows does not open or is not supported, follow the instructions below (these can be followed on any device)
To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code BR5DKKXAX to authenticate.

Unhandled Exception: System.AggregateException: One or more errors occurred. (No such file or directory) ---> System.ComponentModel.Win32Exception: No such file or directory
   at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
   at TunnelRelay.UI.ResourceManagement.UserAuthenticator.AcquireAzureManagementTokenAsync(String tenantId, PromptBehavior promptBehavior, UserIdentifier userIdentifier) in D:\Code\microsoft-teams-tunnelrelay\UI\TunnelRelay.UI.Shared\ResourceManagement\UserAuthenticator.cs:line 238
   at TunnelRelay.UI.ResourceManagement.UserAuthenticator.AuthenticateUserAsync() in D:\Code\microsoft-teams-tunnelrelay\UI\TunnelRelay.UI.Shared\ResourceManagement\UserAuthenticator.cs:line 85
   at TunnelRelay.Console.Program.PerformInteractiveConfigurationAsync(IServiceProvider serviceProvider, String redirectionUrl) in D:\Code\microsoft-teams-tunnelrelay\UI\TunnelRelay.Console\Program.cs:line 249
   at TunnelRelay.Console.Program.<>c__DisplayClass2_0.<<Main>b__0>d.MoveNext() in D:\Code\microsoft-teams-tunnelrelay\UI\TunnelRelay.Console\Program.cs:line 174
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at Microsoft.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args)
   at TunnelRelay.Console.Program.Main(String[] args) in D:\Code\microsoft-teams-tunnelrelay\UI\TunnelRelay.Console\Program.cs:line 234

I've got the exact same error when running without the sudo. I'd be happy to assist debugging this as I could definitely enjoy using the product on Linux.

Thanks!

Subscriptions list is empty

My issue is, that after successful login to my Azure Account the "SelectServiceBus" dialog is shown, but the subscriptions list is empty.
This line returns an empty list and I have absolutely no idea why.
I've updated the code add a tenant selection box. That one shows all my tenants correctly, but it doesn't matter which one I select, the subscriptions list remains empty and returns no results.

Any ideas?

Please make hybrid connection name configurable

It would be nice to use the same hybrid connection and therefore the same URL on different machines. This is currently difficult because Tunnel Relay bases the name of the hybrid connection on the name of the machine. Please allow us to configure this.

Subscription location lookup failure results into UI failure

Sample error

Error - TunnelRelay.Windows.SelectAzureRelay - Failed to get user subscriptionsException - Microsoft.Rest.Azure.CloudException: The access token is from the wrong issuer 'https://sts.windows.net/**TenantUsedInToken**/'. It must match the tenant 'https://sts.windows.net/**TenantAzureThinksShouldBeUsed**/' associated with this subscription. Please use the authority (URL) 'https://login.windows.net/**TenantAzureThinksShouldBeUsed**' to get the token. Note, if the subscription is transferred to another tenant there is no impact to the services, but information about new tenant could take time to propagate (up to an hour). If you just transferred your subscription and see this error message, please try back later.
at Microsoft.Azure.Management.ResourceManager.Fluent.SubscriptionsOperations.ListLocationsWithHttpMessagesAsync(String subscriptionId, Dictionary`2 customHeaders, CancellationToken cancellationToken)
at Microsoft.Azure.Management.ResourceManager.Fluent.SubscriptionsOperationsExtensions.ListLocationsAsync(ISubscriptionsOperations operations, String subscriptionId, CancellationToken cancellationToken)
at TunnelRelay.UI.ResourceManagement.UserAuthenticator.<>c__DisplayClass11_3.<b__6>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at TunnelRelay.UI.ResourceManagement.UserAuthenticator.GetUserSubscriptionsAsync()
at TunnelRelay.Windows.SelectAzureRelay.<Window_ContentRendered>b__7_0()

Ability to have root urls instead of urls with path

Hybrid Connections do not allow root paths i.e. https://xyz.servicebus.windows.net instead the urls will always have paths in them (e.g. https://xyz.servicebus.windows.net/mymachinename). While this works well for non-view webservers, applications which serve CSS or JS files can sometimes trip because of this and instead of hitting https://xyz.servicebus.windows.net/mymachinename/myjs.js hit https://xyz.servicebus.windows.net/myjs.js. This is primarily due to the way webservers are written with assumption that they will be running at root.

One possibility to solve this would be running a FrontDoor resource in Azure which can translate from FrontDoor root url -> Hybrid Connection path based url.

Opening this issue to consider other such avenues.

Replay request

Would love to have the functionality to replay the request. Select the row, and simply issue the request in the same way directly after a request has been received from the relay. That or perhaps pick up the request, and simply re-issue the request to the relay?

This would greatly aid local debugging as request can be replayed without having to ask the external system to re-create it - like calling Twilio again to re-issue the web hook to the defined endpoint.

How to retrieve the public facing endpoint ?

I'm prototyping this tools and it looks far more reliable than other free tunneling tools I tested.

However, I need to dynamically know what the exposed endpoint. When the local server get the request, the host header is localhost.

I can there is a via header, but it only contains the relay host url, not the full url.

Is there any way to retrieve the original url ?

FYI, here's the details of my setup:

  • bridge mounted using the GUI
  • exposed : https://my-relay-namespace.servicebus.windows.net:443/mycomputername
  • routed to : http://localhost:7071
  • seen in via header : 1.1 my-relay-namespace.servicebus.windows.net.

The service behind 7071 port is the local azure function host emulator.

Is use this to implement some SharePoint Addins and the exact exposed url is important because of some callback urls returned by the function.
I may add the url as part of the function settings, but it would simplier I guess to just get the actual URL from, why not, a TunnelRelay specific header ?

TunnelRelay unable to connect to remote server

I'm using the latest version of TunnelRelay for Linux, on a CentOS7 environment.
Upon running the TunnelRelay.Linux.Console script I'm getting the following error -
image
is there anything that could've caused this issue?

Swagger Interface not working via Tunnel Relay

I thought I would post this issue as I think I know what the issue is, but not sure why its an issue. If a build a OpenAPI/Swagger interface in my web site, it all works great. Then I try to get the same Swagger/index.HTML, and it does not display via the Tunnel Relay.

I think I know the issue is with the JavaScript asking for more resources, but I'm not a Javascript guy and hence, as Index.HTML is dynamically generated - not sure where this issue sits.

All I know is that I would like to expose the Swagger/OpenAPI via a public endpoint for initial integration testing. Rather than wait for a deploy cycle each time, I want to interact directly with my desktop, using Tunnel Relay.

Can somebody give this a quick view and even tell me where the error is?

Regards,
Richard

Teams Message Extension BOT - Response not getting back to caller

I have a teams message extension (node.js / javascript / vscode) i am working on and hooked up the relay and setup tunnel relay. I configured my site endpoints and domains to point to my relay hybrid connection listener and i can see the requests coming into tunnel relay and also see the response sent by tunnel relay (or at least sent to tunnel relay from my host). Even though that response is valid it is not getting back to my application in teams and it fails stating it is unable to reach the app.

I am using Tunnel Relay on Windows installed via the MSI downloaded from v2.2 from May 13, 2020.

Is this a known issue or is there a configuration i am missing?

Select Subscription

Hello,

I'm probably being a total newbie, but I cant seem to make a selection. I type the number associated with the subscription and press enter, but nothing happens. What am doing wrong? Thanks for your time.

Error when run on WSL

I downloaded to WSL, ran this:
./TunnelRelay.Linux.Console -RelayUrl jongrelay.servicebus.windows.net -KeyName RootManageSharedAccessKey -Key -Name jonghybrid -Address http://localhost:10000

Got this:

Unhandled exception. System.AggregateException: One or more errors occurred. (Windows Data Protection API (DPAPI) is not supported on this platform.)
 ---> System.PlatformNotSupportedException: Windows Data Protection API (DPAPI) is not supported on this platform.
   at System.Security.Cryptography.ProtectedData.Protect(Byte[] userData, Byte[] optionalEntropy, DataProtectionScope scope)
   at TunnelRelay.UI.StateManagement.DataProtection.Protect(Byte[] data)
   at TunnelRelay.UI.StateManagement.ApplicationData.set_HybridConnectionSharedKey(String value)
   at TunnelRelay.Console.Program.<>c__DisplayClass1_0.<<Main>b__0>d.MoveNext()
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at System.Threading.Tasks.Task`1.get_Result()
   at Microsoft.Extensions.CommandLineUtils.CommandLineApplication.<>c__DisplayClass79_0.<OnExecute>b__0()
   at Microsoft.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args)
   at TunnelRelay.Console.Program.Main(String[] args)

Should it be trying to use DPAPI on Linux?

azsdke2e
azsdke2e2

TunnelRelay Console V2 Alpha Crash On Windows

Hi there!

Thanks for the awesome product :) I'm trying to get the TunnelRelay Console V2 working on windows. After I login and choose the region, the command line crash with exception

Unhandled Exception: System.AggregateException: One or more errors occurred. ---> Microsoft.Azure.Management.Relay.Fluent.Models.ErrorResponseException: Operation returned an invalid status code 'Conflict'
   at Microsoft.Azure.Management.Relay.Fluent.NamespacesOperations.<BeginCreateOrUpdateWithHttpMessagesAsync>d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Azure.Management.Relay.Fluent.NamespacesOperations.<CreateOrUpdateWithHttpMessagesAsync>d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Azure.Management.Relay.Fluent.NamespacesOperationsExtensions.<CreateOrUpdateAsync>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at TunnelRelay.UI.ResourceManagement.ServiceBusResourceManager.<CreateHybridConnectionAsync>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at TunnelRelay.Console.Program.<PerformInteractiveConfigurationAsync>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at TunnelRelay.Console.Program.<>c__DisplayClass2_0.<<Main>b__0>d.MoveNext()
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at Microsoft.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args)
   at TunnelRelay.Console.Program.Main(String[] args)

What do you think? Can you help? Thanks!

Does not work with node.js

I have a very simple node.js application running locally on "http://127.0.0.1:8081/".
This application just returns "Hello world" as "text/plain". Local browsing works well.
Trying to browse via relay url brings an error "No ressource with given identifier found" in Edge developer tools.
Kestrel, IIS Express work

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.