locked
How can I map only specific hubs in SignalR RRS feed

  • Question

  • User-1565612832 posted

    I have two hubs in my application. For the <g class="gr_ gr_15 gr-alert gr_gramm gr_inline_cards gr_run_anim Punctuation only-ins replaceWithoutSep" id="15" data-gr-id="15">one</g> I need NTLM authentication, while IP based filtering for the other. For <g class="gr_ gr_56 gr-alert gr_gramm gr_inline_cards gr_run_anim Punctuation only-ins replaceWithoutSep" id="56" data-gr-id="56">this</g> to <g class="gr_ gr_57 gr-alert gr_gramm gr_inline_cards gr_run_anim Punctuation only-ins replaceWithoutSep" id="57" data-gr-id="57">work</g> I need to <g class="gr_ gr_18 gr-alert gr_gramm gr_inline_cards gr_run_anim Style multiReplace" id="18" data-gr-id="18">set</g><g class="gr_ gr_18 gr-alert gr_gramm gr_inline_cards gr_disable_anim_appear Style multiReplace" id="18" data-gr-id="18"> </g>HttpListener.AuthenticationSchemes<g class="gr_ gr_18 gr-alert gr_gramm gr_inline_cards gr_disable_anim_appear Style multiReplace" id="18" data-gr-id="18"> </g><g class="gr_ gr_19 gr-alert gr_gramm gr_inline_cards gr_run_anim Style multiReplace" id="19" data-gr-id="19"><g class="gr_ gr_18 gr-alert gr_gramm gr_inline_cards gr_disable_anim_appear Style multiReplace" id="18" data-gr-id="18">to</g></g><g class="gr_ gr_19 gr-alert gr_gramm gr_inline_cards gr_disable_anim_appear Style multiReplace" id="19" data-gr-id="19"> </g>AuthenticationSchemes.Ntlm<g class="gr_ gr_19 gr-alert gr_gramm gr_inline_cards gr_disable_anim_appear Style multiReplace" id="19" data-gr-id="19"> </g><g class="gr_ gr_19 gr-alert gr_gramm gr_inline_cards gr_disable_anim_appear Style multiReplace" id="19" data-gr-id="19">for</g> the first, while it remains Anonymous for the other. This means that I can not have both hubs running on the same listener connection. I have <g class="gr_ gr_22 gr-alert gr_gramm gr_inline_cards gr_run_anim Style multiReplace" id="22" data-gr-id="22"><g class="gr_ gr_21 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar multiReplace" id="21" data-gr-id="21">my</g></g><g class="gr_ gr_22 gr-alert gr_gramm gr_inline_cards gr_disable_anim_appear Style multiReplace" id="22" data-gr-id="22"> </g>OwinMiddleware<g class="gr_ gr_22 gr-alert gr_gramm gr_inline_cards gr_disable_anim_appear Style multiReplace" id="22" data-gr-id="22"> </g><g class="gr_ gr_22 gr-alert gr_gramm gr_inline_cards gr_disable_anim_appear Style multiReplace" id="22" data-gr-id="22">to</g> handle the <g class="gr_ gr_307 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling multiReplace" id="307" data-gr-id="307">authorisation</g>, and I am trying to set up two different endpoints for these two hubs (two different ports).

    My problem is that I don't know how to tell SignalR to map only a specific hub <g class="gr_ gr_12 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar replaceWithoutSep" id="12" data-gr-id="12">to</g> <g class="gr_ gr_13 gr-alert gr_gramm gr_inline_cards gr_run_anim Style multiReplace" id="13" data-gr-id="13">specific</g><g class="gr_ gr_13 gr-alert gr_gramm gr_inline_cards gr_disable_anim_appear Style multiReplace" id="13" data-gr-id="13"> </g>IAppBuilder<g class="gr_ gr_13 gr-alert gr_gramm gr_inline_cards gr_disable_anim_appear Style multiReplace" id="13" data-gr-id="13">,</g> and not all hubs that it can find. I have found several methods to do the same with ApiControllers, but nothing for SignalR.

    Thank you!

    Friday, March 30, 2018 7:25 AM

All replies

  • User1325410084 posted

    Other than just breaking them out into separate projects I'm not sure if you could do that within the framework of SignalR.

    If there is a way I'd be curious to know as well.

    Friday, March 30, 2018 3:31 PM
  • User-1565612832 posted
    It seems, that I have found at least two solutions. I started to write an article about them: https://www.codeproject.com/Tips/1237940/One-Possible-Way-of-Selectively-Assigning-Hubs-to
    Tuesday, April 17, 2018 5:26 PM