Comments (5)
Sorry I don't understand what you want.
from cutelyst.
ping?
from cutelyst.
After I've poked around in wsgi code a little bit, I think, that it may not be possible to achieve what I'd like to have. I have also to admit, that maybe, what I want to achieve is not a usual or common use case at all.
Nevertheless I'll try to explain what I meant:
With WSGI it is currently possible to react to web socket events, e.g. by connecting to 'webSocketTextMessage'-signal. But I would love to be able not only to react to certain events, but to get a QWebSocket instance (if some criteria - like certain url for exmaple - are be met) which I can use in underlying qt application.
I could use QWebSockerServer, but then I would need another listening port as WSGI uses.
Maybe wollowing use case will help:
A JavaScript audio player is delievered to user by WSGI and after some user interaction tries to open a websocket connection to obtain audio data for example (url: "ws://mycutelystserver.net/audio/test.mp3"). While on the server such attempt is recognized, and thus corresponding QWebSocket is moved to a 'sending' thread, which sends audio data packet wise and listens for additional commands like 'pause' or 'jump to desired timestamp'. In such scenario I do not only react to some queries with small answers over websocket but actively and continuously send some data.
from cutelyst.
Ok, first, QWebSocket and Cutelyst websocket implementation provide the same set of features, Cutelyst being in some aspects superior, as it's faster, uses less memory, and is defensive by default, it's quite easy to take down a QWebServer by flooding with loads of data if you don't explicit set a limit.
I really think that streaming is best by simply doing HTTP regular requests, but if you want to use WebSockets there's no problem, first BOTH QWebSocket and Cutelyst WS can't be moved to another thread, so you need to do some async approach, then for both you would probably want to send binary data, which is the same way on both.
In fact both implementations passes with 100% score on autobahn websocket testing.
I think you would like to have access to the low level TCP socket, if so then you are out of lucky with both implementations. Still there's no benefit at all on getting it, because that's not the protocol that clients will talk, maybe your issue is due the misconception of a websocket which isn't related to socket as it is in fact a binary protocol.
from cutelyst.
I'm closing due inactivity, when in doubt of implementation it's better to ask on the mailing list
from cutelyst.
Related Issues (20)
- Asynchronous REST API using GUI mode HOT 2
- Epoll event loop on Qt 6.4+
- Macos build error in EventDispatcherEPoll
- Question about Response::redirect HOT 1
- CRASH: Cutelyst is not responsive after wrong request
- Question about default change server/plugins default config HOT 3
- How prevent from session expire time change on some request? HOT 1
- RoleACL problem HOT 3
- How to access Request inside custom tag processing? HOT 2
- Copy-paste issue in CredentialPasswordPrivate::checkPassword HOT 2
- Cutelyst "Authentication plugin not registered" error message when running multithreaded in Kubernetes HOT 6
- Qt 6.5 compatibility and broken QMetaMethod::invoke() HOT 3
- Cutelyst not working with Qt 6.5 HOT 3
- how use qt with mimalloc HOT 1
- SONUM for Cutelyst4
- Problem with call Root::Auto HOT 11
- Qt 6.5.3 problem [was 'Problem with call Root::Auto'] HOT 6
- Multiple configuration files HOT 7
- server config section naming HOT 5
- Tutorial - Authentication - Auto appears to be never called - Qt 6.2.4 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cutelyst.