react-native/Libraries/WebSocket
Christopher Dro e674e45c2e Reverted commit D3040735
Summary:This is a follow up of 9b87e6c860.

- Allows custom headers on connection request
- Adds a default `origin` header to Android, just like iOS

**Introduces no breaking changes.**

I was working on something similar and would like to propose a few changes that make the API more consistent across both iOS and Android platforms and brings this closer to [spec](https://tools.ietf.org/html/rfc6455).

I believe aprock first implementation of adding custom `headers` was correct. It makes sense naming this argument `headers` since we have no other general options available, and the current `options` field is being used to pass in a header anyway.

My use case for custom headers was attaching a token to the `Authorization` header on the connection request. I have been testing this by passing a JWT inside the `Authorization` header and verifying it on the server before establishing a connection.
Closes https://github.com/facebook/react-native/pull/6016

Differential Revision: D3040735

fb-gh-sync-id: 183744d2415b895f9d9fd8ecf6023a546e18a546
shipit-source-id: 183744d2415b895f9d9fd8ecf6023a546e18a546
2016-03-15 07:20:26 -07:00
..
RCTWebSocket.xcodeproj Fix OSS iOS build 2016-02-17 07:38:33 -08:00
__mocks__ Fix tests related to event-target-shim 2015-10-02 12:36:23 -07:00
__tests__ Fixes #3846 2015-11-06 11:24:29 -08:00
RCTSRWebSocket.h Reverted commit D3040735 2016-03-15 07:20:26 -07:00
RCTSRWebSocket.m Reverted commit D3040735 2016-03-15 07:20:26 -07:00
RCTWebSocketExecutor.h Refactored module access to allow for lazy loading 2015-11-25 04:49:45 -08:00
RCTWebSocketExecutor.m Improve Chrome debugger 2016-02-05 15:17:33 -08:00
RCTWebSocketManager.h Enable persistent socket between packager and bridge (1/N). 2016-02-16 23:05:36 -08:00
RCTWebSocketManager.m Enable persistent socket between packager and bridge (1/N). 2016-02-16 23:05:36 -08:00
RCTWebSocketModule.h Make the RCTSRWebSocketDelegate protocol part of RCTWebSocketModule public 2016-01-14 16:13:33 -08:00
RCTWebSocketModule.m Reverted commit D3040735 2016-03-15 07:20:26 -07:00
WebSocket.js Reverted commit D3040735 2016-03-15 07:20:26 -07:00
WebSocketBase.js Annotate WebSocket with Flow 2016-02-16 03:29:52 -08:00
WebSocketEvent.js Implement WebSocket module for Android. Fixes #2837 2015-10-07 08:36:22 -07:00