-
This project currently supports WebSockets and HTTP server. Would you consider also exposing hooks for users to work with TCP sockets? The API would be somewhat similar to that of WebSockets with the required differences. Idea being that users who want high performance EPOLL solution could use this lib instead of |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
Controversial topic - this request/subject has surfaced a few times before.
It is high level because when you do as much as possible in native C++ and only let the very business logic be scripted, you have minimal performance loss and maximum productivity. You get a sweet point where you can, with 4 lines of JavaScript, set up a WebSocket server that outperforms most of all alternatives from within Node.js. That is the reason why this project is what it is. I cannot think of one single case where business logic in a web project would need to directly use TCP or EPOLL. |
Beta Was this translation helpful? Give feedback.
-
@alexhultman what if your business logic is to write a serivce for IoT devices which communicates with those devices using MQTT, STOMP and other protocols? Yes, it would be nice to also have a parser for those protocols in C++, but we are not going to add parsers for all protocols in this project. Say you wanted to implement MQTT using uWS, at least for my use cases, the only thing that could be moved to C++ would be the MQTT packet encoder, but until we don't have that I would be happy to use Node.js MQTT parser with uWS as EPOLL. |
Beta Was this translation helpful? Give feedback.
-
Another use case would be gRPC. (AWS ALB recently added support for gRPC.) |
Beta Was this translation helpful? Give feedback.
-
If uWS TCP stack is faster than Node, another HUGE use case is implementing all database drivers (Redis, MySQL, PostgreSQL, Cassandra etc..) using uWS for TCP. I mean, if you could have a database driver which is 2x faster, everyone would want that. |
Beta Was this translation helpful? Give feedback.
-
This project is about presenting simple solutions to business problematics, with very competitive results. |
Beta Was this translation helpful? Give feedback.
Controversial topic - this request/subject has surfaced a few times before.
It is high level because when you do as much as possible in native C++ and only let the very business logic be scripted, you have minimal performance loss and maximum productivity.
You get a sweet point where you can, with 4 lines of JavaScript, set up a WebSocket server that outperforms most of all alternatives from within Node.js. That is the reason why this project is what it is.
I cannot think of one single case where business logic in a web project would need to directly use TCP or EPOLL.