{"id":17922430,"url":"https://github.com/joyqi/socket-pipe","last_synced_at":"2025-03-24T02:32:31.968Z","repository":{"id":57365110,"uuid":"59683276","full_name":"joyqi/socket-pipe","owner":"joyqi","description":null,"archived":false,"fork":false,"pushed_at":"2018-05-17T03:50:18.000Z","size":49,"stargazers_count":138,"open_issues_count":0,"forks_count":27,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-10-12T21:28:40.115Z","etag":null,"topics":["nodejs","reverse-proxy","tcp-tunnel","tunnel"],"latest_commit_sha":null,"homepage":"https://joyqi.com/javascript/socket-pipe.html","language":"CoffeeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joyqi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-25T17:23:32.000Z","updated_at":"2024-04-28T06:39:25.000Z","dependencies_parsed_at":"2022-09-13T21:11:28.109Z","dependency_job_id":null,"html_url":"https://github.com/joyqi/socket-pipe","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joyqi%2Fsocket-pipe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joyqi%2Fsocket-pipe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joyqi%2Fsocket-pipe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joyqi%2Fsocket-pipe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joyqi","download_url":"https://codeload.github.com/joyqi/socket-pipe/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221932198,"owners_count":16903880,"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","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":["nodejs","reverse-proxy","tcp-tunnel","tunnel"],"created_at":"2024-10-28T20:39:06.278Z","updated_at":"2024-10-28T20:39:06.811Z","avatar_url":"https://github.com/joyqi.png","language":"CoffeeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Socket Pipe\n\nSocket Pipe can forward your socket from one address to anoter without any configs. It supports both tcp and udp, you can simplely make a software net-bridge.\n\n## Install\n\n```\nnpm install -g socket-pipe\n```\n\n## Usage\n\n### Tcp socket forwarding\n\nThe following example shows how to map a remote address (ip=192.168.1.100 port=80) to a local address (ip=127.0.0.1 port=80) via tcp tunnel.\n\n```\nsocket-pipe -l 127.0.0.1@80 -r 192.168.1.100@80 -t tcp\n```\n\n### Udp socket forwarding\n\nThe following example shows how to map a remote address (ip=8.8.8.8 port=53) to a local address (ip=127.0.0.1 port=53) via udp tunnel.\n\n```\nsocket-pipe -l 127.0.0.1@53 -r 8.8.8.8@53 -t udp\n```\n\n### Tcp reverse tunnel\n\nThe following example shows how to map a server from LAN (ip=192.168.1.100 port=80) to internet (ip=123.123.123.123 port=80).\n\n#### Client side (LAN)\n\n```\nsocket-pipe -l 192.168.1.100@80 -r 123.123.123.123@10080 -t tclient\n```\n\n#### Server side (internet)\n\n```\nsocket-pipe -l 123.123.123.123@10080 -r 123.123.123.123@80 -t tserver\n```\n\n### Http reverse tunnel\n\nThe following example shows how to map multi http servers from LAN (ip=[192.168.1.100 - 192.168.1.102] port=80) to internet (ip=123.123.123.123 port=80).\n\n\n#### Client side (LAN)\n\nhttp1\n```\nsocket-pipe -l 192.168.1.100@80 -r 123.123.123.123@10080 -t hclient -x git.dev.com -s git\n```\n\nhttp2\n```\nsocket-pipe -l 192.168.1.101@80 -r 123.123.123.123@10080 -t hclient -x file.dev.com\n```\n\nhttp3\n```\nsocket-pipe -l 192.168.1.102@80 -r 123.123.123.123@10080 -t hclient -s wiki\n```\n\n\n#### Server side (internet)\n\n```\nsocket-pipe -l 123.123.123.123@10080 -r 123.123.123.123@80 -t hserver\n```\n\nThere are two special params.\n\n1. `-x` means socket-pipe will transform:\n    1. The `Host` value in http request header.\n    2. The host part of 'Location' value in http response header.\n2. `-s` means specify a domain prefix. The server side will create a random prefix without specifying.\n\nNow you can visit different backend http server in a LAN from a portal on internet.\n\nFor example if domain `*.test.com` is pointing to `123.123.123.123`, the visits to `http://git.test.com/` will be forwarded to `http://192.168.1.100/` with host `git.dev.com` because of the domain prefix `git`.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoyqi%2Fsocket-pipe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoyqi%2Fsocket-pipe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoyqi%2Fsocket-pipe/lists"}