signalR connection failing when trying to connect with cross domain hosted signalr service

I am trying to consume signalR on a website. SignalR is a self hosted service. SignalR url:

Website is running @

I am getting error on browser console

GET 404 (Not Found)

This error tells me that proxy that the code below is trying to generate is using website url i.e. relative path. However I want to use absolute path where my signalR service is hosted.

AngularJS Factory

app.factory("signalRService", ['$', '$rootScope', function ($, $rootScope) {
    var proxy;
    var connection;

    return {
        connect: function () {
            connection = $.hubConnection();
            proxy = connection.createHubProxy('myHub');
            proxy.on('addMessage', function (tags) {
                $rootScope.$broadcast('addMessage', tags);
        send: function () {

I also added javascript reference for this.

<script src=""></script>

To validate if my self hosting is running file. I checked on browser

enter image description here


What you are missing is a bit of configuration of the proxy:

connection = $.hubConnection('http://localhost:8080/signalr');

How to generalize on that piece of code (the url could be an argument of your connect method, or whatever fits your Angular strategy) is up to you.


 ? SignalR Client Method Fired Multiple Times in Angular Service
 ? How do I refresh SignalR connection if connection timeouts from inactivity
 ? SignalR Connects fine first time, but when Reconnect is initiated, it doesn't complete Reconnect
 ? Getting results twice when calling service with controller
 ? retrieve value in controller when service is called and return the value that we receive from service to controller
 ? Should I have more angular services or controllers?
 ? Should I have more angular services or controllers?
 ? Should I have more angular services or controllers?
 ? AngularJS: controller vs service
 ? How to call a resource in a service through a controller in angularjs