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

Support WebSocket connections in standalone VM HTTP library #2001

Closed
sgjesse opened this issue Mar 6, 2012 · 7 comments
Closed

Support WebSocket connections in standalone VM HTTP library #2001

sgjesse opened this issue Mar 6, 2012 · 7 comments
Assignees
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-io type-enhancement A request for a change that isn't a bug

Comments

@sgjesse
Copy link
Contributor

sgjesse commented Mar 6, 2012

The HTTP library in the standalone VM should support the WebSocket protocol.

It might look something like this:

interface HttpWebSocketConnection {
  void onMessage(...)
  void sendMessage(...)
  ...
}

interface HttpServer {
  ...

  // For handling WebSocket connections.
  onWebSocketConnect(HttpWebSocketConnection connection)
}

With this approach the HttpServer will handle the connection upgrade automatically.

Alternatively it should be possible to control whether to upgrade or not, e.g.:

interface HttpWebSocketOutound {
  void sendMessage(...)
  ...
}

interface WebSocketConnections {
  void onConnect(HttpWebSocketOutound outbound)
  void onMessage(...)
  void onDisconnect(...)
}

interface HttpServer {
  ...

  // For handling WebSocket requests.
  WebSocketConnections onWebSocketConnect(HttpRequest request);
}

If onWebSocketConnect returns null no upgrade/handshake is performed. If an instance of WebSocketConnections is returned this object receives callbacks when something happens in the WebSocket connection. The outbound argument passed to onConnect is used for sending messages.

@DartBot
Copy link

DartBot commented Apr 17, 2012

This comment was originally written by [email protected]


Really wish this was available on the server side so I could keep from having to resort to using Node.js for it. I'm guessing this isn't going to be on the radar for a while though.

@sgjesse
Copy link
Contributor Author

sgjesse commented Apr 17, 2012

This is on the radar and something we will start looking at within a few weeks. Some initial plumbing was added in http://code.google.com/p/dart/source/detail?r=6464.

@DartBot
Copy link

DartBot commented Apr 17, 2012

This comment was originally written by [email protected]


Awesome!

@sgjesse
Copy link
Contributor Author

sgjesse commented Apr 20, 2012

Added Started label.

@sgjesse
Copy link
Contributor Author

sgjesse commented Apr 26, 2012

Initial implementation of the server end of the web socket in the following changes:

http://code.google.com/p/dart/source/detail?r=6998
http://code.google.com/p/dart/source/detail?r=7008

@sgjesse
Copy link
Contributor Author

sgjesse commented May 8, 2012

Web socket client implemented in

http://code.google.com/p/dart/source/detail?r=7224

and with bug-fixes in follow-up changes.


Added Fixed label.

@kevmoo
Copy link
Member

kevmoo commented May 14, 2014

Removed Area-IO label.
Added Area-Library, Library-IO labels.

@sgjesse sgjesse added Type-Enhancement area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-io labels May 14, 2014
@sgjesse sgjesse self-assigned this May 14, 2014
@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug and removed type-enhancement labels Mar 1, 2016
copybara-service bot pushed a commit that referenced this issue May 1, 2023
…, tools, watcher

Revisions updated by `dart tools/rev_sdk_deps.dart`.

ffi (https://github.com/dart-lang/ffi/compare/04fa38a..6d8fa8d):
  6d8fa8d  2023-05-01  dependabot[bot]  Bump actions/checkout from 3.5.0 to 3.5.2 (#191)

lints (https://github.com/dart-lang/lints/compare/f09399a..ba7d75e):
  ba7d75e  2023-04-26  Phil Quitslund  2.1.0 (#107)
  e6b82b6  2023-04-26  Devon Carew  Update lint-propoposal.md (#115)

markdown (https://github.com/dart-lang/markdown/compare/5f98aea..82b050d):
  82b050d  2023-04-30  dependabot[bot]  Bump actions/checkout from 3.5.0 to 3.5.2 (#536)

matcher (https://github.com/dart-lang/matcher/compare/cb6b68c..7228c26):
  7228c26  2023-04-27  dependabot[bot]  Bump dart-lang/setup-dart from 1.4.0 to 1.5.0 (#215)

mockito (https://github.com/dart-lang/mockito/compare/f851e17..beb45ba):
  beb45ba  2023-04-26  yanok  Remove unused local variable
  d2e155f  2023-04-26  yanok  Require Dart SDK >= 2.19
  b777874  2023-04-26  yanok  First part of Dart3 support in Mockito
  ad3c9ae  2023-04-26  yanok  Fix the type variable capture problem
  6c448b2  2023-04-25  oprypin  Keep generated mock files at language version 2.19
  06f353e  2023-04-13  nbosch  Deprecate the mixingIn argument to MockSpec
  f3ecdad  2023-04-11  oprypin  Fix violations of `prefer_final_locals`, `prefer_final_in_for_each` lints

test (https://github.com/dart-lang/test/compare/c9a3138..b252463):
  b252463a  2023-05-01  dependabot[bot]  Bump github/codeql-action from 2.2.9 to 2.3.2 (#2001)

test_process (https://github.com/dart-lang/test_process/compare/946bc27..89c4fdc):
  89c4fdc  2023-05-01  dependabot[bot]  Bump actions/checkout from 3.5.0 to 3.5.2 (#42)

tools (https://github.com/dart-lang/tools/compare/5c9f45c..516995e):
  516995e  2023-04-28  Danny Tuppeny  Change "plugins" to "extensions" for VS Code (#75)

watcher (https://github.com/dart-lang/watcher/compare/00aa79b..6c0c838):
  6c0c838  2023-05-01  dependabot[bot]  Bump actions/checkout from 3.5.0 to 3.5.2 (#144)

Change-Id: I36d0db7f41a26e3f1430b86eff5d63b8e65c1616
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/300321
Reviewed-by: Konstantin Shcheglov <[email protected]>
Commit-Queue: Konstantin Shcheglov <[email protected]>
Auto-Submit: Devon Carew <[email protected]>
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-io type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

3 participants