Skip to content

Error in connect() function #27

@AlessandroAnnini

Description

@AlessandroAnnini

Hi,

i am trying to create a client and connect to a tcp server already listening with this code:

import net from 'net';

const options = {
  host: '192.168.99.182',
  port: '31001',
};

const client = net.createConnection(options, () => {
  console.log('connected')
});

client.on('error', error => {
  console.log(error.message);
});

the problem is that i cannot connect to anything else other than a tcp server hosted in localhost (like your example, that is the only working use case for me)

here is what i log:

socket-0 _read
socket-0 Socket._read resume
socket-0 connecting, host: 192.168.99.182 port: 31001
socket-0 received error
Error in connect() function  <--- (this is from my error event callback)
socket-0 destroying
socket-0 received close

i tried to set "Allow Arbitrary Loads" in the Info.plist file of my IOS project, still nothing changes.

Am I missing something?
Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions