{"id":4714,"url":"https://github.com/PeelTechnologies/react-native-tcp","last_synced_at":"2025-08-04T02:31:29.339Z","repository":{"id":46494226,"uuid":"47419756","full_name":"PeelTechnologies/react-native-tcp","owner":"PeelTechnologies","description":"node's net api in react-native","archived":false,"fork":false,"pushed_at":"2022-11-05T14:56:12.000Z","size":320,"stargazers_count":286,"open_issues_count":55,"forks_count":214,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-06-27T21:54:24.578Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PeelTechnologies.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-12-04T17:42:24.000Z","updated_at":"2025-04-04T04:46:53.000Z","dependencies_parsed_at":"2023-01-21T02:02:42.645Z","dependency_job_id":null,"html_url":"https://github.com/PeelTechnologies/react-native-tcp","commit_stats":null,"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"purl":"pkg:github/PeelTechnologies/react-native-tcp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeelTechnologies%2Freact-native-tcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeelTechnologies%2Freact-native-tcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeelTechnologies%2Freact-native-tcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeelTechnologies%2Freact-native-tcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PeelTechnologies","download_url":"https://codeload.github.com/PeelTechnologies/react-native-tcp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeelTechnologies%2Freact-native-tcp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268015389,"owners_count":24181638,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-31T02:00:08.723Z","response_time":66,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-01-05T20:17:21.095Z","updated_at":"2025-08-04T02:31:28.977Z","avatar_url":"https://github.com/PeelTechnologies.png","language":"Objective-C","funding_links":[],"categories":["Components"],"sub_categories":["Backend"],"readme":"# TCP in React Native\n\nnode's [net](https://nodejs.org/api/net.html) API in React Native\n\nThis module is used by [Peel](http://www.peel.com/)\n\n## Install\n\n* Create a new react-native project. [Check react-native getting started](http://facebook.github.io/react-native/docs/getting-started.html#content)\n\n* In your project dir:\n\n```\nnpm install react-native-tcp --save\n```\n\n__Note for iOS:__ If your react-native version \u003c 0.40 install with this tag instead:\n```\nnpm install react-native-tcp@3.1.0 --save\n```\n\n## Link in the native dependency\n\n```\nreact-native link react-native-tcp\n```\n\n## Additional dependencies\n\n### Due to limitations in the react-native packager, streams need to be hacked in with [rn-nodeify](https://www.npmjs.com/package/rn-nodeify)\n\n1. install rn-nodeify as a dev-dependency\n``` npm install --save-dev rn-nodeify ```\n2. run rn-nodeify manually\n``` rn-nodeify --install stream,process,util --hack ```\n3. optionally you can add this as a postinstall script\n``` \"postinstall\": \"rn-nodeify --install stream,process,util --hack\" ```\n\n## Usage\n\n### package.json\n\n_only if you want to write require('net') in your javascript_\n\n```json\n{\n  \"browser\": {\n    \"net\": \"react-native-tcp\"\n  }\n}\n```\n\n### JS\n\n_see/run [index.ios.js/index.android.js](examples/rctsockets) for a complete example, but basically it's just like net_\n\n```js\nvar net = require('net');\n// OR, if not shimming via package.json \"browser\" field:\n// var net = require('react-native-tcp')\n\nvar server = net.createServer(function(socket) {\n  socket.write('excellent!');\n}).listen(12345);\n\nvar client = net.createConnection(12345);\n\nclient.on('error', function(error) {\n  console.log(error)\n});\n\nclient.on('data', function(data) {\n  console.log('message was received', data)\n});\n```\n\n### TODO\n\nadd select tests from node's tests for net\n\nPR's welcome!\n\n\n\n_originally forked from [react-native-udp](https://github.com/tradle/react-native-udp)_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPeelTechnologies%2Freact-native-tcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FPeelTechnologies%2Freact-native-tcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPeelTechnologies%2Freact-native-tcp/lists"}