Skip to content

WebSocket Transport #43

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

Merged
merged 25 commits into from
Apr 12, 2021
Merged

WebSocket Transport #43

merged 25 commits into from
Apr 12, 2021

Conversation

dnadoba
Copy link
Member

@dnadoba dnadoba commented Apr 2, 2021

add basic WebSocket transport support

Motivation:

make Twitter and Timer examples work

Modifications:

  • generate random Sec-WebSocket-Key as defined in RFC6455
  • add WebSocket KeepAlive support by responding to WebSocket ping frames from server with pong frame
  • forward inbound binary WebSocket frame as ByteBuffer
  • forward outbound ByteBuffer as binary WebSocket frame
  • generate random mask key for outbound WebSocket frames
  • add support for user defined HTTP headers
  • add support for user defined URI
  • simplify all examples by using blocking calls

Result:

Twitter and Timer examples do work now

Discussion

WebSocket text frame

The current implementation just ignores text frames. How do other implementations handle text frames?

WebSocket Fragmentation

The current implementation does not support WebSocket fragmentation. I don't know if we need this because RSocket already supports fragmentation but I could imagine that an intermediate WebSocket Proxy might fragment frames by accident so it might be worth to add it just to be sure.

WebSocket close frame

The current implementation does not handle WebSocket close frames. We definitely need to tackle this in the future.

OlegDokuka and others added 16 commits March 30, 2021 15:37
Signed-off-by: Oleh Dokuka <shadowgun@i.ua>
Signed-off-by: Oleh Dokuka <oleh.dokuka@icloud.com>
Signed-off-by: David Nadoba <dnadoba@gmail.com>
Signed-off-by: David Nadoba <dnadoba@gmail.com>
Signed-off-by: David Nadoba <dnadoba@gmail.com>
Signed-off-by: David Nadoba <dnadoba@gmail.com>
Signed-off-by: David Nadoba <dnadoba@gmail.com>
Signed-off-by: David Nadoba <dnadoba@gmail.com>
Signed-off-by: David Nadoba <dnadoba@gmail.com>
Signed-off-by: David Nadoba <dnadoba@gmail.com>
Signed-off-by: David Nadoba <dnadoba@gmail.com>
Signed-off-by: David Nadoba <dnadoba@gmail.com>
Signed-off-by: David Nadoba <dnadoba@gmail.com>
Signed-off-by: David Nadoba <dnadoba@gmail.com>
Signed-off-by: David Nadoba <dnadoba@gmail.com>
Signed-off-by: David Nadoba <dnadoba@gmail.com>
Signed-off-by: David Nadoba <dnadoba@gmail.com>
dnadoba added 6 commits April 7, 2021 13:32
Signed-off-by: David Nadoba <dnadoba@gmail.com>
Signed-off-by: David Nadoba <dnadoba@gmail.com>
Signed-off-by: David Nadoba <dnadoba@gmail.com>
Signed-off-by: David Nadoba <dnadoba@gmail.com>
Signed-off-by: David Nadoba <dnadoba@gmail.com>
Signed-off-by: David Nadoba <dnadoba@gmail.com>
Copy link

@nkristek nkristek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

dnadoba added 2 commits April 7, 2021 18:36
Signed-off-by: David Nadoba <dnadoba@gmail.com>

Conflicts:
	Sources/RSocketCore/Channel Handler/SetupWriter.swift
Signed-off-by: David Nadoba <dnadoba@gmail.com>
Copy link
Collaborator

@ciychodianda ciychodianda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@nkristek nkristek merged commit 1985e47 into main Apr 12, 2021
@nkristek nkristek deleted the websocket-transport branch April 12, 2021 11:20
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

Successfully merging this pull request may close these issues.

4 participants