question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unrecognized WebSocket connection option(s) `agent`, `perMessageDeflate`, `pfx`, `key`, `passphrase`, `cert`, `ca`, `ciphers`, `rejectUnauthorized`. Did you mean to put these under `headers`?

See original GitHub issue

You want to:

  • report a bug
  • request a feature

Current behaviour

When I install socket.io-client on a blank React Native Expo project I have a yellow message with:

Unrecognized WebSocket connection option(s) `agent`, `perMessageDeflate`, `pfx`, `key`, `passphrase`, `cert`, `ca`, `ciphers`, `rejectUnauthorized`. Did you mean to put these under `headers`?

Steps to reproduce (if the current behaviour is a bug)

yarn add socket.io-client

In App.js in the React Native project:

import React from 'react';
import { YellowBox } from 'react-native';
import io from 'socket.io-client';

YellowBox.ignoreWarnings(['Remote debugger']);

import AppContainer from './config/routing';

export default class App extends React.Component {
    constructor(props) {
        super(props);
    }

    componentWillMount() {
        const socket = io('http://10.0.60.26:3000', {
            forceNew: true
        });
        socket.on('connect', () => console.log('Connection'));
    }

    render() {
        return <AppContainer />;
    }
}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:53
  • Comments:50 (1 by maintainers)

github_iconTop GitHub Comments

23reactions
cdiezmorancommented, Aug 13, 2019

For me it worked when I downgraded to 2.1.1 I did: yarn add socket.io-client@2.1.1

At first it didn’t work because I was adding the ^ symbol before the version socket.io-client@^2.1.1 which I believe accepts other minor versions of the package.

17reactions
isthaisoncommented, Mar 31, 2020

const _io = ioClient.connect(socketurl, { forceNode: true }); It’s work

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unrecognized WebSocket connection option(s) `agent ...
Yes, this is happening in the WebSocket class constructor in Socket.io. I think it happens when you specify your transport layer as ...
Read more >
Unrecognized WebSocket connection option(s) `agent ...
... `perMessageDeflate`, `pfx`, `key`, `passphrase`, `cert`, `ca`, `ciphers`, `rejectUnauthorized`. Did you mean to put these under `headers ...
Read more >
class socksproxyagent extends agent_base_1.agent - You.com
Unrecognized WebSocket connection option (s) `agent`, `perMessageDeflate`, `pfx`, `key`, `passphrase`, `cert`, `ca`, `ciphers`, `rejectUnauthorized`. Did you ...
Read more >
Error message occurs when trying to upload pfx certificate to ...
Hello,. We have an App Service running containing a Wordpress instance. I need to update the wildcard SSL certificate as it is about...
Read more >
React-Native 웹소켓 사용 시 Unrecognized WebSocket ... - velog
React Native + Expo: Unrecognized WebSocket connection option(s) #1855. ... `rejectUnauthorized`. Did you mean to put these under `headers`? ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found