• Stars
    star
    138
  • Rank 263,581 (Top 6 %)
  • Language
    CoffeeScript
  • Created over 8 years ago
  • Updated over 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Socket Pipe

Socket 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.

Install

npm install -g socket-pipe

Usage

Tcp socket forwarding

The 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.

socket-pipe -l 127.0.0.1@80 -r 192.168.1.100@80 -t tcp

Udp socket forwarding

The 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.

socket-pipe -l 127.0.0.1@53 -r 8.8.8.8@53 -t udp

Tcp reverse tunnel

The 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).

Client side (LAN)

socket-pipe -l 192.168.1.100@80 -r 123.123.123.123@10080 -t tclient

Server side (internet)

socket-pipe -l 123.123.123.123@10080 -r 123.123.123.123@80 -t tserver

Http reverse tunnel

The 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).

Client side (LAN)

http1

socket-pipe -l 192.168.1.100@80 -r 123.123.123.123@10080 -t hclient -x git.dev.com -s git

http2

socket-pipe -l 192.168.1.101@80 -r 123.123.123.123@10080 -t hclient -x file.dev.com

http3

socket-pipe -l 192.168.1.102@80 -r 123.123.123.123@10080 -t hclient -s wiki

Server side (internet)

socket-pipe -l 123.123.123.123@10080 -r 123.123.123.123@80 -t hserver

There are two special params.

  1. -x means socket-pipe will transform:
    1. The Host value in http request header.
    2. The host part of 'Location' value in http response header.
  2. -s means specify a domain prefix. The server side will create a random prefix without specifying.

Now you can visit different backend http server in a LAN from a portal on internet.

For 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.

More Repositories

1

sfz

专门用于给图片加水印打码的工具,完全基于浏览器本地API,无任何网络请求(特别适合身份证等敏感证件)
CoffeeScript
583
star
2

mobile-device-js

Detect mobile's device model using javascript
JavaScript
201
star
3

logecho

A static blog engine
PHP
93
star
4

takahashi-template

使用markdown撰写高桥流的PPT
HTML
30
star
5

node-openai

An elegant NodeJs library for openai api.
TypeScript
28
star
6

translatorchain

A Node.js command line tool to translate formatted localized strings into other languages using OpenAI's GPT API.
TypeScript
21
star
7

launching-framework

超轻量级php框架
PHP
21
star
8

ncov2019

从官方数据中提取我感兴趣的2019新型冠状病毒发展情况
TypeScript
20
star
9

weibo-request

利用 m.weibo.cn 的公开接口读取单条微博数据
CoffeeScript
17
star
10

jtunnel

懂得自然懂
CoffeeScript
11
star
11

acme-bot

运行于 Docker 容器中的,基于 acme.sh 的 SSL 证书自动更新和部署机器人
Shell
11
star
12

lampweekly

蓝谱周刊 | LampWeekly
8
star
13

sharebychatgpt-extension

A browser extension summarize web pages with ChatGPT for easy sharing on social media.
TypeScript
8
star
14

typescript-module-template

A template for creating a npm module written in TypeScript.
TypeScript
7
star
15

typecho-plugin-sitemap

自动生成 Typecho 站点地图的插件
PHP
7
star
16

typecho-plugins

Some useful plugins for typecho.
PHP
6
star
17

echoeditor

回声编辑器
CoffeeScript
5
star
18

snabbful

Snabbful is a simple, fast, and flexible library for building user interfaces by using Snabbdom.
TypeScript
5
star
19

chatchain

Use LangChain to read text and vectorize it for generating dialogue scenarios.
TypeScript
4
star
20

go-lafi

A graceful golang sdk for Lark/Feishu
Go
4
star
21

logecho-simple-server

CoffeeScript
3
star
22

ppt

使用Markdown在线创建或者预览PPT
3
star
23

parsedown-coffee

A CoffeeScript port for Parsedown
CoffeeScript
3
star
24

typeditor

Typeditor is a simple editor for macosx
Objective-C
3
star
25

shit

搜集屎一样的代码,供大家瞻仰,供后辈凭吊
2
star
26

docker-anarki

A Docker image file for deploying Hacker News like sites, based on the latest version of Anarki code and Racket language runtime.
Shell
2
star
27

UTFT

A port of UTFT library with 180 degrees rotate supporting
C
2
star
28

ts-koa-router-decorators

Koa router decorators for TypeScript
TypeScript
2
star
29

bootsdown

Transfer your markdown text into bootstrap
CoffeeScript
2
star
30

koa-pug-middleware

A Koa Pug view render middleware.
TypeScript
1
star
31

browser-fetch

Use playwright to fetch website page.
TypeScript
1
star
32

node-inmemory

A simple in-memory cache system for node.js.
TypeScript
1
star