Commit Graph

86 Commits

Author SHA1 Message Date
Pawel Kadluczka ae815475b8 Support for binary protocols on the server side 2017-07-20 17:46:45 -07:00
Hao Kung 2d16cd2273 React to default auth change 2017-07-07 19:20:20 -07:00
David Fowler 53e09f8cc3 Fix flaky test (#622)
- Remove timeout and closed the application when the transport closes.
Made some tweaks to TestWebSocketConnectionFeature as a result.
- This uncovered some interesting issues with the WebSocketTransport itself so
further refactoring is needed to make it a bit more solid.
2017-06-30 02:30:09 -07:00
Hao Kung d125a14a39 React to HttpAbstractions 2017-06-29 16:30:38 -07:00
Pranav K 08c04f8912 Fix NuGet downgrade warnings from CoreFxLab packages 2017-06-29 10:31:32 -07:00
David Fowler 6332e98d03 Remove Try from Write methods (#614)
- We write to a Stream so it should never fail (it could throw
but that's not new).
2017-06-28 21:53:23 -07:00
BrennanConroy dc29e98032 Support Authorize attribute on EndPoints (#606) 2017-06-28 14:52:52 -07:00
BrennanConroy e36da30072 Ignore failed send after close (WebSockets) (#593) 2017-06-27 10:01:45 -07:00
David Fowler 9602787463 Fix broken SSE transport 2017-06-23 14:27:03 -07:00
BrennanConroy ef273b4796 Add authorization per hub method (#577) 2017-06-23 10:22:05 -07:00
David Fowler a84ba8820f Use Channel<byte[]> as the abstraction (#579)
* Use Channel<byte[]> as the abstraction
2017-06-23 09:52:35 -07:00
David Fowler 41f54d001b Remove dependencies on a bunch of corefxlab things (#576)
* Remove dependencies on a bunch of corefxlab things
- Used Stream instead of IOutput
- Removed pipelines dependency in most places.
2017-06-22 09:23:52 -07:00
BrennanConroy 0dd29b3050 Always close websocket on server (#567)
* refactor server websockets transport
2017-06-20 16:00:32 -07:00
BrennanConroy 0298868c00 Reorganize and add more logging to Sockets.Http (#549)
* Move Sockets.Transports to internal namespace
2017-06-15 08:24:43 -07:00
Pawel Kadluczka 6576bb0ea4 Making the build pass after we took new packages 2017-06-14 15:32:20 -07:00
David Fowler 523517f60c Add support for timing out poll requests (#538)
* Add support for timing out poll requests
- Default poll request is 110 seconds (like in previous versions of SignalR)
- Use 200 with a 0 content length for timeouts.
- Added support for not timing out while debugging
2017-06-07 20:55:00 -10:00
BrennanConroy d1df3671d8 Add Auth Test that was accidentally deleted (#541) 2017-06-07 14:29:59 -07:00
Pawel Kadluczka a14a0ab039 Adding structured negotiate 2017-06-06 15:53:21 -07:00
BrennanConroy 4c4be7ed6f Add support for Hub Authorize Attribute (#532) 2017-06-06 15:46:08 -07:00
David Fowler 38efde7b50 Merge transport and hub protocols (#517)
* Merge transport and hub protocols
- This change merges the transport and hub protocols into a single protocol. The
idea being that sockets in a purely streaming layer that sends frames from the underlying
transport. This makes things like TCP possible and doesn't impose a framing layer at the lowest
level. This will make it possible to build servers like kestrel on top of the TCP layer.
- The Message was removed from the lowest layer of the stack and pushed into the hubs layer. Hub invocations
are framed with what was before the transport protocol. Connections also need to state upfront if they support
binary or not. This will determine how data will be serialized to the specific connection.
- Changed the SSE parser and writer to be strictly SSE without any of the transport protocol specific
information.
- To ensure we aren't using types in the wrong layers
- Moved protocol logic into SignalR
- Socket.Abstractions is now the root of the universe, Sockets.Common will likely be removed
or turned into Sockets.Common.Http.
- Move SSE parser to Sockets.Client and SSE writer into Sockets.Http
- Moved tests into the appropriate test projects
- Updated the spec
2017-06-05 09:45:40 -10:00
David Fowler 831fa72893 Remove the RequestId from DefaultConnectionContext (#516)
* Remove the RequestId from DefaultConnectionContext
- Added a GetHttpContext() extension method on ConnectionContext
- Also fixed an issue not setting LastSeenUtc
2017-06-03 22:05:44 -10:00
David Fowler b77f50a99a Merge DefaultConnectionContext with ConnectionState (#514)
* Merge DefaultConnectionContext with ConnectionState
- Removed ConnectionState as a result
2017-06-03 12:14:01 -10:00
David Fowler 42e2715a95 Removed EndOfMessage from Message (#513)
* Removed EndOfMessage from Message
- The webSockets transport no longer supports partial payloads so
this feature is now gone.
2017-06-03 08:32:28 -10:00
David Fowler 72423ee203 Removed custom websocket implementation (#507)
- Use the default websocket middleware
- Rewrote TestWebSocketConnectionFeature to use Channels instead of pipes
2017-06-03 06:53:39 -10:00
Pawel Kadluczka e31fc1e57d Closing transports with error if hubs cannot be created
- Preventing from closing long polling transport with 204 in case of
error
- Reporting an error to the client if WebSocket was not closed normally

Note in case of ServerSentEvents it is not possible on the client to
tell the difference between when the server closed event stream due to
an exception or because the client left OnConnectedAsync. In both cases
the client sees only that the stream was closed.

Part of: #163
2017-05-31 16:29:28 -07:00
Mikael Mengistu b862d35b10 Update Targets (#486) 2017-05-26 20:00:12 -04:00
Hao Kung fbf7e1fb72 Add auth reference 2017-05-25 21:56:28 -07:00
Hao Kung 42739b064f React to Auth + switch to PolicyEvaluator 2017-05-25 18:22:51 -07:00
David Fowler d55ebfeee0 Split http and non-http layers (#487)
* Split http and non-http layers
- This change introduces Microsoft.AspNetCore.SignalR.Http
and Microsoft.AspNetCore.Sockets.Http which expose extension methods
on IAppBuilder for wiring up a sockets and signalr pipeline.
2017-05-24 07:09:46 -07:00
David Fowler 9d9a52119e Progress towards splitting the layers (#473)
* Progress towards splitting the layers
- This is based on the work anurse did in anurse/endpoint-middleware-spike to
introduce a connection middleware pipeline that mimics much of our http
pipeline. The intent is that this layer will be generic enough to build both
SignalR and Kestrel on top of but we're not there yet. This change makes incremental
progress towards splitting apart sockets and http so that we can add the tcp transport
without breaking everything all at once.
- Created Microsoft.AspNetCore.Sockets.Abstractions where the primitives for
sockets live. That includes, ConnectionContext (formerly Connection), EndPoint,
ISocketBuilder, SocketDelegate, etc.
- ConnectionContext isn't in it's final form as yet, it still very closely mirrors
the original Connection object we had so that tests continue to pass.
- The HttpConnectionDispatcher doesn't know about EndPoint anymore, it just cares
about invoking the SocketDelegate.
- EndPointOptions has been removed as part of this change as it coupled http specific configuration
to the end point type. There's a new HttpSocketOptions that needs to be passed into MapSocket calls.
- Updated the tests to deal with the API changes.
2017-05-23 02:43:32 -07:00
David Fowler 323dae4ce9 Handle case where scanning happens after dispose. (#475)
- ConnectionManager.Scan would null ref because the timer.Change was being called
after closing all connections.
2017-05-21 23:19:17 -07:00
David Fowler 2aabce48b4 Remove custom routing and path matching from HttpConnectionDispatcher (#471)
- We're now using the routing system in a very vanilla way now that
we're not using the URL space as part of the protocol.
- Removed the path argument from the HttpConnectionDispatcher (simplifies code and removes duplication from tests)
2017-05-20 00:34:29 -07:00
David Fowler 240a88f7af Make the http end points more resty (#470)
- Use HTTP verbs to describe functionality for endpoints
- Updated TransportProtocols.md
2017-05-19 23:37:17 -07:00
Nate McMaster ef7a3514cd Upgrade test framework versions and fix test issues (#453) 2017-05-15 12:50:30 -07:00
Andrew Stanton-Nurse ca9a44afc3 Merge branch 'rel/2.0.0-preview1' into dev 2017-05-04 14:11:16 -07:00
Mikael Mengistu 7f64811ccd Change targets (#437)
Target netcoreapp2.0
2017-05-04 14:05:58 -07:00
moozzyk 82f99a1424 Work around for a Firefox bug
Firefox won't fire EventSource open event until it receives some data. The workaround is to send an empty comment when starting ServerSentEvent transport.

Fixes: #352
2017-04-27 10:34:47 -07:00
moozzyk e691e1cff8 Removing legacy raw format for `send`
Fixes issues #383 and #127
2017-04-18 11:34:43 -07:00
BrennanConroy 9993fd96da Use policy names in EndPointOptions (#340) 2017-04-11 12:35:31 -07:00
David Fowler 0546dc21f4 Disable response buffering via the IHttpBufferingFeature (#379)
* Disable response buffering via the IHttpBufferingFeature
- To make sure SignalR works with servers and middleware
that do perform response buffering, disable it via the
IHttpBufferingFeature for SSE.
- Added test to verify buffering is disabled
2017-04-10 19:05:06 -07:00
David Fowler 5df022df0c Remove skipped tests and increased timeout for failing test 2017-04-04 22:13:12 -07:00
David Fowler 3b8e1a5380 Added a close timeout to the web socket transport
- Today we don't end the request if the application completes
but the websocket transport hasn't gotten the receive frame as yet.
This changes adds a WebSocketOptions.CloseTimeout to EndPointOptions
that allows configuring this timeout. When the timeout is reached, we abort
the connection and end the transport task so that the request can end.
- Added tests for websocket timeout and skipped tests for application timeouts
2017-04-04 09:59:41 -07:00
David Fowler 87e6da6e4c Handle exceptions and Cancellation in DisposeAsync (#366) 2017-04-03 22:21:41 -07:00
David Fowler 8da2dddd49 Fix issue where multiple calls to dispose don't wait properly (#360)
* Fix issue where multiple calls to dispose don't wait properly
- DisposeAsync returned immediately to anyone but the first caller.
This means that it was possible to end the request before properly
waiting on the transport task which means writing after dispose was possible.
- Added a test
2017-04-03 15:25:45 -07:00
BrennanConroy 6130003193 Convert to netcoreapp2.0 (#338)
* Converted samples and test projects to run on netcoreapp2.0
2017-03-25 09:37:39 -07:00
David Fowler 10782d59a2 Dev gate (#326)
* React to corefxlab
2017-03-21 08:48:32 -07:00
David Fowler 63ce7f6160 Supported transports (#294)
Supported transport spike
- Allow turning transports on or off per end point with a flags enum
- Added `TransportType` to Sockets.Common
- Added tests
2017-03-20 12:23:00 -07:00
Andrew Stanton-Nurse ab3dce85fc tidy up status codes and transport conflicts (#306) 2017-03-20 09:48:15 -07:00
Andrew Stanton-Nurse 1732ac5760 add support for binary format in /poll (#303) 2017-03-16 11:06:26 -07:00
Andrew Stanton-Nurse 0133153bc9 use new protocol for '/send' (#297) 2017-03-15 18:03:23 -07:00