Search code examples
websocketreact-nativejavascriptcore

Use TCP socket in React Native?


I want to create a TCP socket in React Native, connect to a telnet server with port of 23.

I found there has 'RCTWebSocket', but it seems only support http, https, ws, wss protocols, and always occurred error when remote response.

Is there a way to use TCP Socket which not only for http, ws protocols ?


Solution

  • You could try native objective c tcp socket with a js interface. Look for "extension " in the react native github page.