Skip to content

WebSocket in Android doesn't work #6

@haozeng

Description

@haozeng

Description

We have React-Native app built for both IOS and Android. The websocket works well with IOS. But when we are testing in android, it always says failed to upgrade to WebSocket.

Here are some logs we read both from backend server for IOS and Android. Not able to capture any useful logs when websocket connection is built from the mobile side.

The backend is rails 5 with action cable and on mobile side, we are using a library that uses actioncable API (https://github.com/schneidmaster/action-cable-react)

Any feedback is greatly appreciated.

2017-06-21T23:05:05.850190+00:00 heroku[router]: at=info method=GET path="/cable" host=anyperk-wellness.herokuapp.com request_id=911403d4-64f7-472b-83fd-6a31780deac5 fwd="4.16.194.94" dyno=web.1 connect=0ms service=3ms status=404 bytes=429 protocol=https
2017-06-21T23:05:05.846086+00:00 app[web.1]: I, [2017-06-21T16:05:05.846002 #4]  INFO -- : [911403d4-64f7-472b-83fd-6a31780deac5] Started GET "/cable" for 4.16.194.94 at 2017-06-21 16:05:05 -0700
2017-06-21T23:05:05.846932+00:00 app[web.1]: I, [2017-06-21T16:05:05.846873 #4]  INFO -- : [911403d4-64f7-472b-83fd-6a31780deac5] Started GET "/cable/" [WebSocket] for 4.16.194.94 at 2017-06-21 16:05:05 -0700
2017-06-21T23:05:05.847023+00:00 app[web.1]: E, [2017-06-21T16:05:05.846970 #4] ERROR -- : [911403d4-64f7-472b-83fd-6a31780deac5] Request origin not allowed: https://anyperk-wellness.herokuapp.com/
2017-06-21T23:05:05.847112+00:00 app[web.1]: E, [2017-06-21T16:05:05.847051 #4] ERROR -- : [911403d4-64f7-472b-83fd-6a31780deac5] Failed to upgrade to WebSocket (REQUEST_METHOD: GET, HTTP_CONNECTION: Upgrade, HTTP_UPGRADE: websocket)
2017-06-21T23:05:05.847181+00:00 app[web.1]: I, [2017-06-21T16:05:05.847134 #4]  INFO -- : [911403d4-64f7-472b-83fd-6a31780deac5] Finished "/cable/" [WebSocket] for 4.16.194.94 at 2017-06-21 16:05:05 -0700
2017-06-21T23:06:04.870791+00:00 app[web.1]: I, [2017-06-21T16:06:04.870693 #4]  INFO -- : [748b96e8-217b-4435-9c7b-242f7924f69a] Started GET "/cable" for 166.137.242.115 at 2017-06-21 16:06:04 -0700
2017-06-21T23:06:04.871459+00:00 app[web.1]: I, [2017-06-21T16:06:04.871404 #4]  INFO -- : [748b96e8-217b-4435-9c7b-242f7924f69a] Started GET "/cable/" [WebSocket] for 166.137.242.115 at 2017-06-21 16:06:04 -0700
2017-06-21T23:06:04.871532+00:00 app[web.1]: I, [2017-06-21T16:06:04.871492 #4]  INFO -- : [748b96e8-217b-4435-9c7b-242f7924f69a] Successfully upgraded to WebSocket (REQUEST_METHOD: GET, HTTP_CONNECTION: Upgrade, HTTP_UPGRADE: websocket)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions