Sifir-io / react-native-tor

Tor Daemon and Socks5 client for React Native iOS and Android projects!
MIT License
101 stars 15 forks source link

[TcpConnection ] Socket Usage Example - Lack of server side code example #40

Closed matetuh closed 2 years ago

matetuh commented 2 years ago

Hello ✋

in the Socket Usage Example tab https://github.com/Sifir-io/react-native-tor#socket-usage-example, only the client side tcp connection code example is shown. Can you provide an example of server-side code that is able to handle queries sent to the server from a client? Or can you write what package to use to handle these queries?

Additionally, I think I found a bug in the README. Because in the folder 'example / src / App.test.tsx' https://github.com/Sifir-io/react-native-tor/blob/main/example/src/App.test.tsx the method 'createTcpConnection ()' (120 lines of code) is called from the variable 'client' which is the function 'TorBridge ()' (6 lines of code). In README however, the method 'createTcpConnection ()' is called from the variable 'tor' which is a function 'Tor ()'. Is this a bug? Because i tried the code and only the one from example works.

Example TCP connection in react-native-tor: -example/src/App.test.tsx image image -README image

Thanks 👍

gabidi commented 2 years ago

Hi,

  1. A TCP socket Example depends on the language you're using but any standard socket server would work (ex: Node.js net ), just make sure the data emitted is new line delineated, from README.md:

    
    Ergo sum the current implementation is only suited for text data that is line delineated (Electrum server, etc..)
    Future implementations will support constant streams of buffered base64 data.
  2. Not sure I understand what the bug being referenced is....
matetuh commented 2 years ago

Hi,

  1. Is it possible for you to present the server code used in the example 'example / src / App.test.tsx' ?

In the example there is an onion link that you can connect to via tcp and I tested this example and it works. I would just like to see an example of handling these inquiries from tcp tor. image

  1. As for the bug, I wonder if the README should not be updated with the code from the 'example / src / App.test.tsx'.

Thank you for your reply! 👍