Possible to redirect traffic to/from shiny through separate websocket server?

Assume that, for whatever reason, I can't allow a web server to be run directly out of R. That means I can't have httpuv opening up a socket.

So, I would like to write a server separately and have it make calls to Shiny functions using data from a Shiny client, and return the appropriate responses. Somewhere in the middle of this process is the server(input, output) function, but clearly the input needs to be deserialized, formatted, etc, before it's used, and to the output the reverse should be done before it heads back out to the client.

There must be some "in" function and some "out" function, outside the core shiny functionality but inside the httpuv layers. Can anyone help me track those down? I've spent quite a while looking so far, but the chain of function calls and object hierarchies is not at all clear from the source, and on the output end I'm having difficulty because objects are often private so I can't figure how to retrieve their data.

Sorry if this all seems nonsensical/pointless and super in the weeds, but I'm really hoping someone can give me a bit of insight into my problem, or at least help me think a little more clearly about it.

Thanks all!