vadimpronin / guacamole-lite

Node.js library for creating Guacamole-compatible servers. Guacamole is a RDP/VNC/SSH/Telnet client for HTML5 browsers.
Apache License 2.0
250 stars 78 forks source link

newConnection usage #21

Closed dnapier closed 6 years ago

dnapier commented 6 years ago

Hi, I'm trying to understand when newConnection gets called, if ever. Being outside of the constructor, I'm looking for a call or callback for it, but can't find one. Does it get exported as an event through EventEmitter?

vadimpronin commented 6 years ago

Hey, It's called every time there's a new incoming websocket connection. WS emits "connection" event and we attach newConnection as callback for this event here https://github.com/vadimpronin/guacamole-lite/blob/master/lib/Server.js#L128

dnapier commented 6 years ago

Ah! Thanks so much for that, I totally missed the binding.