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 support close #99 #103

Merged
merged 6 commits into from
Jul 20, 2021
Merged

WebSocket support close #99 #103

merged 6 commits into from
Jul 20, 2021

Conversation

benja-wu
Copy link
Contributor

@benja-wu benja-wu commented Jul 5, 2021

  1. Introducing WebSocketServer into Easegress

TODO

  1. Considering to merge it into HTTPServer, and managed by TrafficController.
  2. Updating HTTPPipeline for handling this none-one-request-one-response scenario.(Two way long-life connection)

@benja-wu benja-wu added the enhancement New feature or request label Jul 5, 2021
@benja-wu benja-wu added this to the v1.0.2 milestone Jul 5, 2021
@benja-wu benja-wu added this to In progress in Easegress Project via automation Jul 5, 2021
@benja-wu benja-wu linked an issue Jul 6, 2021 that may be closed by this pull request
Copy link
Contributor

@xxx7xxxx xxx7xxxx left a comment

Choose a reason for hiding this comment

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

This is kind of a simple websocket proxy isolated with other components in EG, there left work to naturally merged it into existed traffic ecosystem.

pkg/object/websocketserver/proxy.go Outdated Show resolved Hide resolved
pkg/object/websocketserver/proxy.go Outdated Show resolved Hide resolved
pkg/object/websocketserver/proxy.go Outdated Show resolved Hide resolved
pkg/object/websocketserver/proxy.go Outdated Show resolved Hide resolved
pkg/object/websocketserver/spec.go Outdated Show resolved Hide resolved
// Spec describes the HTTPServer.
Spec struct {
Port uint16 `yaml:"port" jsonschema:"required,minimum=1"`
HTTPS bool `yaml:"https" jsonschema:"required"`
Copy link
Contributor

Choose a reason for hiding this comment

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

HTTPS? Should it be WSS or EnableTLS?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, this service can enable TLS in two places, one is the HTTP server it starts with, the other is the backend WebSocket's.

  • This HTTPS is for the original HTTP server this proxy works on. (Before protocol switching)
  • The backend WebSocket service's TLS configure can be enabled when it starts with wss in URL.

pkg/object/websocketserver/proxy.go Show resolved Hide resolved
pkg/object/websocketserver/proxy.go Outdated Show resolved Hide resolved
pkg/object/websocketserver/proxy.go Outdated Show resolved Hide resolved
pkg/object/websocketserver/proxy.go Outdated Show resolved Hide resolved
@benja-wu
Copy link
Contributor Author

benja-wu commented Jul 8, 2021

This is kind of a simple websocket proxy isolated with other components in EG, there left work to naturally merged it into existed traffic ecosystem.

@xxx7xxxx Yes, cause I haven't figure out how to update the TrafficController and RawTrafficController for handling none-HTTP related traffic, such as TCP, WebSocket(After protocol switching, it uses TCP connection directly). And the Pipeline also needs to be updated for handling the none-one-request-one-response scenario.

We need a big issue and design for this, not only for WebSocket/TCP, but also for MQTT protocol.

@benja-wu benja-wu closed this Jul 9, 2021
@benja-wu benja-wu deleted the websocket branch July 9, 2021 03:05
Easegress Project automation moved this from In progress to Done Jul 9, 2021
@benja-wu benja-wu restored the websocket branch July 9, 2021 03:07
@benja-wu benja-wu reopened this Jul 9, 2021
Easegress Project automation moved this from Done to In progress Jul 9, 2021
pkg/object/websocketserver/proxy.go Outdated Show resolved Hide resolved
pkg/object/websocketserver/proxy.go Outdated Show resolved Hide resolved
pkg/object/websocketserver/spec.go Show resolved Hide resolved
pkg/object/websocketserver/spec.go Outdated Show resolved Hide resolved
@benja-wu
Copy link
Contributor Author

Updated as comments.

Easegress Project automation moved this from In progress to Reviewer approved Jul 20, 2021
@xxx7xxxx xxx7xxxx merged commit a36ff16 into easegress-io:main Jul 20, 2021
Easegress Project automation moved this from Reviewer approved to Done Jul 20, 2021
@benja-wu benja-wu deleted the websocket branch July 20, 2021 05:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

Successfully merging this pull request may close these issues.

[feature] WebSocket support
3 participants