Open snopywithchary opened 10 months ago
Without knowing your use case, I can only suggest https://wails.io/docs/guides/dynamic-assets/
Without knowing your use case, I can only suggest https://wails.io/docs/guides/dynamic-assets/ I have a video, the backend reads the video and sends the image data to the frontend for rendering, I am currently using websocket transport because I didn't find a more efficient transport method in wails
There are certain scenarios where json encoding and decoding is costly, such as photoshop and video editing software. While the use of binary with Uint8Array in websockets can temporarily handle this, it would be nice to have binary support built into the binding.
SharedBuffer would be good. What about Mac and Linux though?
SharedBuffer would be good. What about Mac and Linux though?
There are no such things on those platforms. The only thing that works there is streaming responses through the AssetServer as you already mentioned (https://wails.io/docs/guides/dynamic-assets/)
I have a video, the backend reads the video and sends the image data to the frontend for rendering, I am currently using websocket transport because I didn't find a more efficient transport method in wails
Please be aware, Websockets don't work over the custom scheme used in-app, unless you are starting your own http server on the network stack.
@stffabi
Would be awesome if sockets were used for the IO between the Backend and Frontend.
Pushup does it this way for golang htmx projects.
https://github.com/adhocteam/pushup/blob/main/_runtime/cmd/main.go#L29
@gedw99 Opening unix sockets or ports on the network stack is probably not a feature people want to see in a default Wails app. That would allow to intercept traffic from backend/frontend relatively easy, that's why the AssetServer is not bound to the network stack and uses IPC.
But if someone wants to do that, that is pretty easily doable with just a couple of lines in Go to start a http server and use that in your frontend.
Any update on this one?
i have same problem @snopywithchary
Will gladly accept a PR for this if anyone wants to try.
Is your feature request related to a problem? Please describe.
I use wails to transmit binary image streams, but I found that if I bind the method of transmitting binary, wails will automatically base64 encode the binary. Is there a more efficient method?
Describe the solution you'd like
such as this: https://github.com/MicrosoftEdge/WebView2Feedback/blob/main/specs/SharedBuffer.md
Describe alternatives you've considered
No response
Additional context
No response