vtortola / WebSocketListener

A lightweight and scalable asynchronous WebSocket listener
http://vtortola.github.io/WebSocketListener
313 stars 85 forks source link

problems with examples #123

Closed roblatour closed 5 years ago

roblatour commented 6 years ago

attempting to use the example here there are a couple compiler errors that get thrown, these are:

  1. _listener.Standards.RegisterStandard(new WebSocketFactoryRfc6455(_listener)); does not contain a constructor that takes 1 arguments

and

  1. while (_listener.IsStarted) 'WebSocketListener' does not contain a definition for 'IsStarted' and no extension method 'IsStarted' accepting a first argument of type 'WebSocketListener' could be found (are you missing a using directive or an assembly reference?)

I tried replacing them with:

  1. _listener.Standards.RegisterStandard(new WebSocketFactoryRfc6455()); and
  2. While (ture);

but the program doesn't seem to work while listening to wss://stream.pushbullet.com/websocket/xxxxxxxxx so maybe I have the changes wrong?

In any case, any help would be appreciated.

vtortola commented 6 years ago

Have you tried with the whole project at https://github.com/vtortola/WebSocketListener/tree/master/samples/WebSocketEventListener ?

That project was using a previous version of WebSocketListener (2.1.3 according to packages.config), you should not get those compilation errors with that version.

roblatour commented 6 years ago

Yes - that is where I got the sample from. I did not however try it with the older (2.1.3) version rather I was using the current version (3.0). Reverting to the older version did remove the compile errors, but the sample is still not reporting messages from wss://stream.pushbullet.com/websocket/xxxxxxxxx.

The wss://stream.pushbullet.com/websocket/xxxxxxxxx service does seem to be working correctly when tested with http://jsfiddle.net/pushbullet/u92DA/

vtortola commented 6 years ago

In order to use secure websockets you need to setup a certificate, either through WebSocketListener WSS support or using a reverse proxy with SSL termination

vtortola commented 6 years ago

The reason why is not working in your setup may vary. Try it locally first.

roblatour commented 6 years ago

thanks - I'm going to have to do some more home-work.