-
Notifications
You must be signed in to change notification settings - Fork 142
Documentation and Comments #3
Comments
A JavaScript demo would also be nice. The library looks like a really promising alternative to SignalR which is somewhat heavy and has a dependency on jQuery still baked in it for JavaScript clients. |
What I'm hearing is: "we need to see an end to end typical use case". I get On Fri, 19 Feb 2016 14:50 Luljan Bacaj [email protected] wrote:
|
@mgravell yeah that would be awesome. Like @Ibacaj I am looking for something like SignalR without the bloat which makes SignalR completely unusable for game development. For my case I need a concept of channels / groups (send to a subset of users). and Presence (broadcasting when a user disconnects). Looking at the code, I noticed the Broadcast method accepted a func for sending to select users. I also noticed the heartbeat. Am I correct to assume this is a possibility for NetGain ? If so, it would be great if you included this. Not needed, but nice to have would be some sort of user state. Something like userName, I didnt see an extensible point for the connection, maybe there is another way ? You mentioned Auth and storage. Agree they are not needed, but some pointers on how to go about this (Dos and Donts) would always be welcome. Also, I would be happy to help with a demo on the client side (Xamarin or Unity or Mvc or whatever) once a interface is ready. |
A simple chat client with user to user communication, and examples with SSL would be nice. |
Re state: that is all built in; there is an object (UserToken) that you can Broadcast can indeed be used to talk to a great many nodes; you can pass a We use NetGain as part of chat.SE, so it all sounds possible. What we DO NOT currently support is SSL (wss). We haven't needed to. On 22 February 2016 at 15:37, pjanning [email protected] wrote:
Regards, Marc |
@mgravell is this UserToken shared between client and server or will I need to come up with a handshake ? |
I am looking forward to see examples. :) Depending on your implementation WSS/SSL isn't needed. Do you have more informations about chat.SE? |
I have a non-working sample. I may be doing something wrong on the client side, I'm not a native JS speaker. https://github.com/NVentimiglia/NetGain/tree/master/StackExchange.NetGainWebChat My exact error is
Ill try again later |
Try to use 'ws://127.0.0.1:6002' as URL. This should work. |
That got me further. My firewall is off, anything else you can think of ? Edit Worked fine when I ran the console app independent of the web app. It would be nice to run within the web app for prototyping without a VM. |
@mgravell Is there any way to handle onconnect / ondisconnect serverside ? |
The typical usage would be to subclass WebSocketsMessageProcessor; this OnOpened Does that answer the question? On 1 March 2016 at 03:34, Nicholas Ventimiglia [email protected]
Regards, Marc |
@rherwig and me built a little example with NetGain. Here are our Repositories: https://github.com/pjanning/NetGain-ChatExample/ (Backend) |
nice; awesome stuff On 2 March 2016 at 07:46, pjanning [email protected] wrote:
Regards, Marc |
@mgravell I have one question. Why don't you need WSS at StackExchange? |
In a perfect world, we'd probably make use of it, but basically we considered:
So basically, in our scenario, the optimum approach seems to be: only broadcast a "hey, there's more stuff you should know" (not the actual stuff, just a hand wave "hey you!" - no PII in there, note). Trivially simple (and public) stuff like rep / voting: we just update on screen from that, but in most cases we display a notification to the user that new stuff is available (which could be a red inbox envelope, or a "new questions / answers are available" banner). When the user actually clicks on that, we use regular AJAX to our main site with our regular security model etc. In other scenarios, I totally agree that wss would be not just desirable but necessary. The problem is: it isn't a small amount of work to do it! Now; on a related note, I suspect that if we want to move to .net core, some massive changes (aka basically a rewrite) would be necessary. Whether that is sensible or not, I don't know at this point - it could well be that the reduced API surface in .net core means that it simply doesn't scale in the way we need. And there are now more and better tools in this space than existed when we first wrote this. But hypothetically, if we were gutting it for .net core purposes that forced us to use different APIs, that might also be a good time to consider wss. Or maybe it isn't! But I certainly can't think of any clean way to implement it right now. |
@pjanning To expand on that, @NickCraver has reminded me that we do use wss, but: not at the library level. We terminate that at the NLB (haproxy). The library does not support wss, but it can still be done externally. We didn't use wss initially, hence the above. |
To add to the WSS discussion, because this is important: we don't use WSS for security at Stack Overflow. Nothing of a secure nature is sent over them. We use WSS because a great many (especially older) proxies on the internet do not handle websockets connections correctly. While most of these will totally screw up an unencrypted websocket connection, they'll happily pass along an encrypted connection they don't understand. It's a "bad proxy" workaround in our case, and for many others out there. |
Thank you for your answers. @NickCraver, @mgravell I was really confused, how you could use NetGain at StackExchange. If i set up an Webpage which is accessed via SSL. I have to use WSS. Otherwise i would not get an connection. Your solution to use a proxy for this sounds good. Thank you! |
How does this http://vtortola.github.io/WebSocketListener/ fit against NetGain ? |
@pjanning @mgravell Any hints about how are you sending initial data (for example, username or so ) on initial connection (for example onOpen or On Authenticate) ? |
@mgravell |
How do you use the WebSocketsMessageProcessor as a subclass? |
Some very basic documentation defining the key features of NetGains would be nice. Looking at the code I see support for HeartBeat (kicking dead connections), an serverside interface for handling disconnections, authentication, and messages. I also see a UserToken, is this some sort of client session? Its hard to tell because none of the methods have comments.
Also maybe a WebApi / MVC serverside demo would be nice
The text was updated successfully, but these errors were encountered: