Saturday, 15 May 2010

c# - How do you hide hubs from signalr users? -



c# - How do you hide hubs from signalr users? -

i have implemented next javascript code:

var comhub = $.hubconnection(); var comhubproxy = comhub.createhubproxy("chathub"); registerclientmethods(comhubproxy); comhubproxy.on("onconnected", function (username, userlist, friendlist, grouphistory, grouplist, clanlist, roomid) { }); comhub.start().done(function () { registerevents(comhubproxy); });

where registerclientmethods(..) , registerevents(..) declare server , client methods. works perfectly, issue have 2 hubs. one, , super secret admin one. oh, super secret wish.

my issue doing little checking, , decided i'd inspect hub connection. , oh, horror.

$.connection.hub.proxies

that 1 line, , hello super secret hub name. of course, can connect , boom hello functions. then, yeah cant utilize them, since have farther security measures , checks. uneasy can /see/ them! there way configure hub setup connect hubs depending on proxy generated? started attempting i'm pretty muddled...

var hubconfig = new hubconfiguration(); hubconfig.enabledetailederrors = false; hubconfig.enablejavascriptproxies = true; app.mapsignalr("/signalr", hubconfig); app.mapsignalr("/secret", hubconfig); globalhost.hubpipeline.requireauthentication();

c# asp.net-mvc asp.net-mvc-5 signalr

No comments:

Post a Comment