You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Has anybody tackled the implementation of websockets with the webview2 control ?
We currently have a React front-end that pulls its data from the web server via HTTP requests but it also uses websockets to be notified from the server.
The same React front-end is also hosted in a traditional winforms application with a webview2 control. We started virtually hosting the React front-end files and by intercepting the data requests with the WebResourceRequested event. But now, websockets...
There doesn't seem to be a simple way to implement that. Simply, websockets need 2 things : an initial subscription request and then maintaining a tcp connection with client to call it back. First, I started by investigating whether the initial websocket subscription request could be handled with the WebResourceRequested event. It could listen for it but it seems to be missing one crucial part, the tcp connection, if there is actually a tcp connection, when requests are intercepted with the WebResourceRequested event.
I am starting to wonder if I will have to implement a local tcp server inside my winforms application to handle websockets.
Anyone use websockets and a virtually hosted web application in a webview2 control ?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Has anybody tackled the implementation of websockets with the webview2 control ?
We currently have a React front-end that pulls its data from the web server via HTTP requests but it also uses websockets to be notified from the server.
The same React front-end is also hosted in a traditional winforms application with a webview2 control. We started virtually hosting the React front-end files and by intercepting the data requests with the WebResourceRequested event. But now, websockets...
There doesn't seem to be a simple way to implement that. Simply, websockets need 2 things : an initial subscription request and then maintaining a tcp connection with client to call it back. First, I started by investigating whether the initial websocket subscription request could be handled with the WebResourceRequested event. It could listen for it but it seems to be missing one crucial part, the tcp connection, if there is actually a tcp connection, when requests are intercepted with the WebResourceRequested event.
I am starting to wonder if I will have to implement a local tcp server inside my winforms application to handle websockets.
Anyone use websockets and a virtually hosted web application in a webview2 control ?
Beta Was this translation helpful? Give feedback.
All reactions