locked
SignalR on a remote server with RESTful API RRS feed

  • Question

  • User-1061648496 posted

    I've implemented a self hosted signalr server that starts with my RESTful API, i've tried connecting to it from two different clients using

    "http://localhost:8077/"

    1- A console application. "Connected"

    2- A mobile app (using react native). "Connected"

    My problem is that the API will be on a remote server so i'm trying to change the signalr host url from "localhost" to an ip address to test against it as a remote server, this is what i've tried:

    "http://*:8077", This one worked only when i run visual studio as administrator but not on IIS.
    "http://+:8077", This one worked only when i run visual studio as administrator but not on IIS.
    "http://mylocalipaddress:8077", never worked.

    So am i doing something wrong here? or am i missing something in my implementation?

    Sunday, February 26, 2017 8:43 AM

Answers

  • User-1061648496 posted

    Thanks for your answer, i managed to overcome my problem by doing the following:

    1. Created an OWIN Startup class and i added the signalr mapping in it -i had the startup class before but in a separate project for some reason thought it was a good idea-.

    app.MapSignalR()

    2. Downloaded the owin.hosting.systemweb for the startup class to get detected.

    and by doing that the signalr server was hooked on the same ipaddress and port as the api but accessed with a "/signalr" at the end of the url

    Thank you for your help

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, February 28, 2017 9:07 AM

All replies

  • User1771544211 posted

    Hi Sam Nasser,

    "http://*:8077", This one worked only when i run visual studio as administrator but not on IIS.

    Please check the following features

    1. Ping the IP address on your client PC to test if the network is fine.

    2. Please check if your IIS server's firewall blocked the port 8077

    "http://mylocalipaddress:8077", never worked.

    Could you please share the error message here?

    Best Regards,

    Jean

    Monday, February 27, 2017 5:37 AM
  • User-1061648496 posted

    1. Pinging works fine.

    2. Port 8077 is not blocked on the iis server's firewall.

    I get this error 

    "Access Denied"

    Monday, February 27, 2017 10:14 AM
  • User1771544211 posted

    Hi Sam Nasser,

    "Access Denied"

    Based on my experience, the "Access Denied" error usually occurs when you don't have permission to access the resource that you visit.

    In your case, I think the most possible reason is your IIS requires authentication, but your request doesn't contain the authentication information.

    Please check the authentication settings on your IIS, enable the Anonymous Authentication and disable other authentication.

    1. Open your IIS

    2. Navigate to your Restful API

    3. Click the Authentication feature

    4. Enable the Anonymous Authentication and disable other authentication

    Best Regards,

    Jean

    Tuesday, February 28, 2017 1:59 AM
  • User-1061648496 posted

    Thanks for your answer, i managed to overcome my problem by doing the following:

    1. Created an OWIN Startup class and i added the signalr mapping in it -i had the startup class before but in a separate project for some reason thought it was a good idea-.

    app.MapSignalR()

    2. Downloaded the owin.hosting.systemweb for the startup class to get detected.

    and by doing that the signalr server was hooked on the same ipaddress and port as the api but accessed with a "/signalr" at the end of the url

    Thank you for your help

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, February 28, 2017 9:07 AM