Coder Social home page Coder Social logo

azure-relay-aspnetserver's Introduction

ASP.NET Core Hosting for Azure Relay

This repo contains a web server for ASP.NET Core based on Azure Relay Hybrid Connections HTTP. A NuGet package produced from this repo is available on NuGet as Microsoft.Azure.Relay.AspNetCore.

The integration supports most ASP.NET scenarios, with a few exceptions. WebSocket support will be added in the near future, for instance.

To use the extension, take the following steps:

  1. Add the Microsoft.Azure.Relay.AspNetCore assembly to your project.
  2. Create a Hybrid Connection
  3. After you have created the Hybrid Connection, find its "Shared Access Policies" portal tab and add a new rule "listen" with the Listen-permission checked.
  4. Once the rule has been created, select it and copy its connection string.

The connection string contains all information to set up a listener. The samples in the samples subfolder take the connection string as input.

The .UseAzureRelay() hosting extension is available via the Microsoft.Azure.Relay.AspNetCore namespace.

You MUST remove all IISExpress references in the launchSettings.json of any ASP.NET Core application you create from a template. The IIS Express settings are incompatible with this extension.

using Microsoft.Azure.Relay.AspNetCore;


var host = new WebHostBuilder()
    .ConfigureLogging(factory => factory.AddConsole())
    .UseStartup<Startup>()
        .UseAzureRelay(options =>
        {
            options.UrlPrefixes.Add(connectionString);
        })
    .Build();

host.Run();

azure-relay-aspnetserver's People

Contributors

tratcher avatar pranavkm avatar davidfowl avatar juntaoluo avatar ntaylormullen avatar aspnetci avatar dougbu avatar troydai avatar chengtian avatar ryanbrandenburg avatar brennanconroy avatar haok avatar clemensv avatar pakrym avatar adrosa avatar kichalla avatar ajaybhargavb avatar dlstucki avatar jkotalik avatar ivadim avatar bricelam avatar kirthik avatar loudej avatar halter73 avatar jhawk42 avatar eilon avatar javiercn avatar anpete avatar stuartleeks avatar rynowak avatar

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.