Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Websocket module #1425

Closed
luismfonseca opened this issue Jul 28, 2016 · 2 comments
Closed

Websocket module #1425

luismfonseca opened this issue Jul 28, 2016 · 2 comments

Comments

@luismfonseca
Copy link
Contributor

luismfonseca commented Jul 28, 2016

Missing feature

A native Websocket module.

Justification

The websockets allow a two-way communication between the client and server, so it's more well suited for IoT applications where one would like to stream data.
Being an upgradable protocol from HTTP this means the existing infrastructure can still handle websockets connections.

The nodemcu offers an net module for more raw control of the connection - this, however, is an higher-level protocol that sits on the same level of abstraction of the http.

The main advantage for a native module is heap usage.

Workarounds

There are 2 projects that implement this in Lua [1] [2]. Both use more than 10KB of heap.

Implementation

I'm aware this is a non-trivial effort, therefore I'm also volunteering to do this myself. Although I feel I should reach out for possible implementation discussion & comments.
I'm also more interested in a client version, although after a client is done, a server should not be too hard.

@Governa
Copy link

Governa commented Oct 14, 2016

I've found some problems with the websockets module while using secure connections. While it would work with something like wss://echo.websocket.org, it didn't with my tornado development server.

For some reason, its callbacks are called with an empty buffer and len == 0 and the code stops working. I've added some checks for those cases and it seems to work.

Governa@c7f8c3b

@marcelstoer
Copy link
Member

@Governa Please raise a PR with your changes. Look at the SSL/TLS notes at http://nodemcu.readthedocs.io/en/latest/en/modules/net/ for a likely reason why secure connections might fail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants