libvncclient: add hooks for custom socket I/O#477
libvncclient: add hooks for custom socket I/O#477tobydox wants to merge 1 commit intoLibVNC:masterfrom
Conversation
|
Am currently on vacation, can review end of July - how does this relate to / replace #234? |
|
It's related partially only since it proposes changes to the RFB protocol for negotiating TLS. This PR is much more generic and not even TLS related, TLS is just a use case. |
032bd7f to
a30177f
Compare
b36c293 to
dcd031d
Compare
|
IIRC this is about generic tunneling, an example of how to make use of this would be super helpful. |
c0796c6 to
72c2e71
Compare
|
I need a connect hook to negotiate with a proxy server before handing the connection to libvncclient. I rolled my own before seeing this one. The ConnectToRFBServer hook proposed here would meet my need. |
This allows using libvncclient on any kind of custom transport, e.g. for TLS tunneling via a special TLS socket implementation.
|
I'm back working on this topic, specifically to make libvncclient usable with a custom Websocket implementation. @bk138: you mentioned an example would be helpful. Should I add a file in client/examples using the new callbacks? Alternatively I could extend the Qt example to work with QWebSockets (which would be my use case as well). |
|
Hi Toby, |
| * ReadFromRFBServer() - keep at 0 to disable timeout detection and handling */ | ||
| unsigned int readTimeout; | ||
|
|
||
| /** hooks for custom socket I/O */ |
There was a problem hiding this comment.
these should go at the end of the struct for ABI compatibility
| return TRUE; | ||
| } | ||
|
|
||
| if(client->ConnectToRFBServer) |
There was a problem hiding this comment.
I feel this should be modelled more like in #234 in that we have a DefaultConnectToRFBServer (with the body of the original ConnectToRFBServer) that is wired to the callback per default.
This allows using libvncclient on any kind of custom transport, e.g. for TLS tunneling via a special TLS socket implementation. May be the function pointer / hook names can be improved to better reflect the actual purpose.