I am writing a c# console client to connect to SignalR service of a server. Using a bit of Wiresharking, Firebugging and examining the .../signalr/hubs document on the server, I was able to connect on the default "/signalr" URL:
var connection = new HubConnection("https://www.website.com");
var defaultHub = connection.CreateHubProxy("liveOfferHub");
connection.Start().ContinueWith(task =>
{
if (task.IsFaulted)
{
Console.WriteLine("Error opening the connection:" + task.Exception.GetBaseException());
}
else
{
Console.WriteLine("SignalR Connected");
}
}).Wait();
Now I need to find out
The IHubManager
interface or HubManagerExtensions
class look promising, but I was not even able to find out, what classes implement it and how to use it. Asp.net/signalr offers only basic documentation and tutorials.
Thanks in advance for pointing me in the right direction!
I think what you are looking for is something like a WSDL for SignalR.
No, SignalR doesn't have something that complex. What you can get, manually, is from the SignalR proxy: ./signalr/hubs
.
If you look at this code from the proxy
proxies.chatHub = this.createHubProxy('chatHub'); //hub name
proxies.chatHub.client = { };
proxies.chatHub.server = {
serverMethod: function (firstParameter, secondParameter, thridParameter) { //hub method and number of parameters
return proxies.chatHub.invoke.apply(proxies.chatHub, $.merge(["ServerMethod"], $.makeArray(arguments)));
}
};
you get only:
- hub names (chatHub
)
- server methods and number of parameters (serverMethod
, 3 parameters)
So, the only info is that your hub looks something like this:
[HubName("chatHub")]
public class ?? : Hub
{
public ?? ServerMethod(?? firstParameter, ?? secondParameter, ?? thridParameter)
{
??
}
}
The client methods are not really in any list and are used on the fly. You can catch them with Fiddler.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With