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 URL property undefined #25260

Closed
tegandbiscuits opened this issue Jun 13, 2019 · 2 comments
Closed

WebSocket URL property undefined #25260

tegandbiscuits opened this issue Jun 13, 2019 · 2 comments
Labels
Bug Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@tegandbiscuits
Copy link

The properties url, protocol, and bufferedAmount on instances of WebSocket are returning undefined (on iOS at least).

I'm able to successfully connect using both of the given values, but accessing either doesn't work as expected. This causes problems for clients that depend on having either value.

However, readyState seems to be working correctly. I haven't checked extensions.

React Native version:

  React Native Environment Info:
    System:
      OS: macOS 10.14.5
      CPU: (8) x64 Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz
      Memory: 62.36 MB / 16.00 GB
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 10.15.3 - /usr/local/bin/node
      Yarn: 1.15.2 - /usr/local/bin/yarn
      npm: 6.4.1 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2
    IDEs:
      Android Studio: 3.4 AI-183.6156.11.34.5522156
      Xcode: 10.2.1/10E1001 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.8.3 => 16.8.3
      react-native: 0.59.9 => 0.59.9
    npmGlobalPackages:
      react-native-cli: 2.0.1

Steps To Reproduce

  1. Create a new WebSocket that uses a subprotocol
  2. After connecting, attempt to access url or protocol

Describe what you expected to happen:

If I do const ws = new WebSocket('ws://localhost:8080, 'some-protocol')`

ws.url and ws.protocol should return ws://localhost:8080 and some-protocol respectively.

Snack, code example, or link to a repository:

https://github.com/NRauh/react-native-websocket-issue

Here's a minimal example of a ws server and clients. The browser client works as expected, but the react native app does not.

@stale
Copy link

stale bot commented Sep 12, 2019

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Sep 12, 2019
@stale
Copy link

stale bot commented Sep 19, 2019

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

@stale stale bot closed this as completed Sep 19, 2019
@facebook facebook locked as resolved and limited conversation to collaborators Sep 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

1 participant