mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-23 03:50:11 +08:00
Added an optional options parameter for WebSockets
Summary: This enables overriding origin, and other request headers. Similar to the https://github.com/websockets/ws api. Closes https://github.com/facebook/react-native/pull/4629 Reviewed By: svcscm Differential Revision: D2839951 Pulled By: mkonicek fb-gh-sync-id: 3578af4343f90572b8851ff28342a05945498ef6
This commit is contained in:
committed by
facebook-github-bot-4
parent
15f806957f
commit
9b87e6c860
@@ -44,9 +44,9 @@ RCT_EXPORT_MODULE()
|
||||
}
|
||||
}
|
||||
|
||||
RCT_EXPORT_METHOD(connect:(NSURL *)URL socketID:(nonnull NSNumber *)socketID)
|
||||
RCT_EXPORT_METHOD(connect:(NSURL *)URL protocols:(NSArray *)protocols options:(NSDictionary *)options socketID:(nonnull NSNumber *)socketID)
|
||||
{
|
||||
RCTSRWebSocket *webSocket = [[RCTSRWebSocket alloc] initWithURL:URL];
|
||||
RCTSRWebSocket *webSocket = [[RCTSRWebSocket alloc] initWithURL:URL protocols:protocols options:options];
|
||||
webSocket.delegate = self;
|
||||
webSocket.reactTag = socketID;
|
||||
if (!_sockets) {
|
||||
|
||||
Reference in New Issue
Block a user