Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebSocket proxy PoC #3170

Closed
sbordet opened this issue Nov 29, 2018 · 0 comments
Closed

WebSocket proxy PoC #3170

sbordet opened this issue Nov 29, 2018 · 0 comments
Assignees

Comments

@sbordet
Copy link
Contributor

sbordet commented Nov 29, 2018

@lachlan-roberts @gregw @joakime the new WebSocket in Jetty 10 must be able to implement a proxy proof of concept (e.g. as a test).
I would like to see a remote client send a WebSocket message to the proxy, which forwards it to a WebSocket server, and viceversa (from server to proxy to client), all non-blocking.
I know the JSR API cannot do this non-blocking, but I would like the Jetty API or the core API to be able to do so.

lachlan-roberts added a commit to lachlan-roberts/jetty.project that referenced this issue Feb 5, 2019
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
lachlan-roberts added a commit to lachlan-roberts/jetty.project that referenced this issue Feb 7, 2019
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
lachlan-roberts added a commit to lachlan-roberts/jetty.project that referenced this issue Feb 11, 2019
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
lachlan-roberts added a commit to lachlan-roberts/jetty.project that referenced this issue Feb 13, 2019
- Introduced an EMPTY_SESSION in the ProxyFrameHandler as a terminal
state to know whether a FailedCoreSession has been handled

- Use while(true) loops to do the compareAndSet in ProxyFrameHandler

- Improved the tests for the proxy so that it tests the frames received
at every state (ie Client Proxy and Server)

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
lachlan-roberts added a commit to lachlan-roberts/jetty.project that referenced this issue Feb 13, 2019
- Redesigned the proxy into a new class called WebSocketProxy containing
a Client2Proxy FrameHandler and a Server2Proxy FrameHandler

- WebSocketProxy uses synchronized blocks with an enum state instead
of the previous compare and sets

- Created a new test similar to ProxyFrameHandlerTest to test the new
WebSocketProxy

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
lachlan-roberts added a commit to lachlan-roberts/jetty.project that referenced this issue Feb 14, 2019
…nges

only do state changes inside synchronized blocks, remember what action
to do and only do this outside of the synchronized block

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
lachlan-roberts added a commit to lachlan-roberts/jetty.project that referenced this issue Feb 18, 2019
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
lachlan-roberts added a commit to lachlan-roberts/jetty.project that referenced this issue Feb 18, 2019
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
lachlan-roberts added a commit to lachlan-roberts/jetty.project that referenced this issue Feb 18, 2019
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
lachlan-roberts added a commit to lachlan-roberts/jetty.project that referenced this issue Feb 18, 2019
- Introduced an EMPTY_SESSION in the ProxyFrameHandler as a terminal
state to know whether a FailedCoreSession has been handled

- Use while(true) loops to do the compareAndSet in ProxyFrameHandler

- Improved the tests for the proxy so that it tests the frames received
at every state (ie Client Proxy and Server)

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
lachlan-roberts added a commit to lachlan-roberts/jetty.project that referenced this issue Feb 18, 2019
- Redesigned the proxy into a new class called WebSocketProxy containing
a Client2Proxy FrameHandler and a Server2Proxy FrameHandler

- WebSocketProxy uses synchronized blocks with an enum state instead
of the previous compare and sets

- Created a new test similar to ProxyFrameHandlerTest to test the new
WebSocketProxy

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
lachlan-roberts added a commit to lachlan-roberts/jetty.project that referenced this issue Feb 18, 2019
…nges

only do state changes inside synchronized blocks, remember what action
to do and only do this outside of the synchronized block

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
lachlan-roberts added a commit to lachlan-roberts/jetty.project that referenced this issue Feb 18, 2019
- Added test cases to test failures in and around the WebSocketProxy
and how it handles them.

- In WebSocketChannel.sendFrame() we were using a null cause for
closeConnection, we are now extracting the cause from the
AbnormalCloseStatus. This was resulting in onError not being called
when there was actually an error and an AbnormalCloseStatus.

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
lachlan-roberts added a commit to lachlan-roberts/jetty.project that referenced this issue Feb 18, 2019
removing old versions of the proxy frame handler

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
lachlan-roberts added a commit to lachlan-roberts/jetty.project that referenced this issue Feb 18, 2019
removing old versions of the proxy frame handler
adding licence headers

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
lachlan-roberts added a commit to lachlan-roberts/jetty.project that referenced this issue Feb 18, 2019
removing old versions of the proxy frame handler
adding licence headers

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
lachlan-roberts added a commit to lachlan-roberts/jetty.project that referenced this issue Feb 22, 2019
Signed-off-by: lachan-roberts <lachlan@webtide.com>
lachlan-roberts added a commit to lachlan-roberts/jetty.project that referenced this issue Feb 28, 2019
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
lachlan-roberts added a commit to lachlan-roberts/jetty.project that referenced this issue Feb 28, 2019
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
lachlan-roberts added a commit to lachlan-roberts/jetty.project that referenced this issue Jun 11, 2019
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
lachlan-roberts added a commit that referenced this issue Jul 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants