reaktivity / nukleus.spec

Nukleus Specification
Apache License 2.0
0 stars 6 forks source link

How to ignore extension data? #10

Open dpwspoon opened 7 years ago

dpwspoon commented 7 years ago

When running a WS to TCP proxy I had the following config (note: this is js code not checked in currently)


var tcpOutputRef = tcpController.routeOutputNew("ws", 0, "127.0.0.1", 1050, "proxy").get(); 
var wsInputRef = wsController.routeInputNew("http", 0, "tcp", tcpOutputRef, null).get();
var httpInputRef = httpController.routeInputNew("tcp", 0, "ws", wsInputRef, headers).get(); 
var tcpInputRef = tcpController.routeInputNew("any", port, "http", httpInputRef, address).get();

The "empty" extension from the tcpOutput is presented to the WebSocket. The WebSocket doesn't know what to do with that extension, as it as already negotiated echo

jfallows commented 7 years ago

The BEGIN extension presented by the tcp nukleus has structure TcpBeginEx from tcp.idl, however the ws nukleus just tries to interpret the bytes as a WsBeginEx, as it would for ws echo scenario.

We need a way to either indicate the type of the BEGIN extension, or add the capability to omit the BEGIN extension, perhaps when configuring the ROUTE.

It may be desirable (and more efficient) to opt-in to the BEGIN extension and omit by default, however that would also impact logging.

jfallows commented 5 years ago

We now have typeId on core::stream::Extension which can be used to identify the owner nukleus.

jfallows commented 4 years ago

However, this can still be an issue for back to back proxying, such as tcp to tls proxy.