MCPcopy Index your code
hub / github.com/UnsignedInt8/LightSword

github.com/UnsignedInt8/LightSword @v0.7.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.7.2 ↗ · + Follow
666 symbols 1,140 edges 52 files 119 documented · 18%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

LightSword

Build Status Gitter

LightSword —— 基于 Node.js 的 SOCKS5 代理 / Apple NE 服务器。

LightSword 参考了 Shadowsocks 的协议,并用 Typescript 实现。LightSword 基于 Node.js 4.0+,因此需要首先安装 Node.js 4.0 以上版本,点击访问官方网址

Quick Start

首先,安装Node.js 4.0+,安装好 Node.js 之后,即可使用 Node.js 的包管理器 npm 安装 LightSword 。目前 npmjs.org 可以访问,因此可以直接安装:

1.安装

[sudo] npm install lightsword -g

安装完成之后,即可使用客户端,服务器端,中转站端。

服务器端: lsserver, lightsword-server, lightsword

中转站端: lsbridge, lightsword-bridge

客户端: lslocal, lightsword-client

简单地说明下中转站的作用:

由于某些不为人知的原因,访问境外IP时不时丢包非常严重,因此可以把中转站搭建在云提供商服务器上,作为中转/中继使用,具有较好的效果(在一定程度上提高了匿名性)。

2.运行

服务器:

lsserver -f

客户端:

lslocal -s server_addr -f

中转站:

lsbridge -s server_addr -f

以上配置均使用内置默认设置,详细参数请参见源码文件夹中的 README.md 文件(参见: server, client, bridge 这三个文件夹)。

经实际测试,中转服务器对 Shadowsocks 有效。理论上支持任何形式的 TCP 流量中转。

最后配置你的浏览器及其它需要上网的软件使用 LightSword 提供的 SOCKS5 代理。

默认监听地址: localhost

端口: 1080

Linux 支持

misc 文件夹下,已经写好了 Linux 启动脚本,你可以根据自己的实际情况,修改运行参数。并放到 init.d 目录下,再 chkconfig on 或者其它 Linux 分发版的命令激活自动运行即可。

快速安装方法:

Ubuntu 用户

# Using Ubuntu
[sudo] apt-get update -y
[sudo] apt-get install curl -y

[sudo] curl -sL https://deb.nodesource.com/setup_5.x | sudo -E bash -
[sudo] apt-get install -y nodejs
[sudo] npm install lightsword -g

Debian 用户

# Using Debian, as root
[sudo] apt-get update -y
[sudo] apt-get install curl -y

[sudo] curl -sL https://deb.nodesource.com/setup_5.x | bash -
[sudo] apt-get install -y nodejs
[sudo] npm install lightsword -g

RHEL 6, CentOS 6 用户

# Using RHEL 6, CentOS 6
[sudo] yum update
[sudo] yum install curl

[sudo] curl -sL https://rpm.nodesource.com/setup_5.x | bash -
[sudo] npm install lightsword -g

Apple 用户

Apple 用户只需要运行服务器,即可打开iOS客户端填写配置并投入使用。如需测试 DNS 泄漏,请访问https://dnsleaktest.com

建议在运行的时候加入 --cluster 参数,以提升服务器性能和稳定性。

默认端口: 8900

默认密码: lightsword.neko

默认算法: AES-256-CFB

License

GPLv2.0

Extension points exported contracts — how you extend this code

Error (Interface)
* * * Node.js v4.x API * * [1 implementers]
typings/node/node.d.ts
IRunnable (Interface)
Partial interface for Mocha's `Runnable` class.
typings/mocha/mocha.d.ts
ISocketAsync (Interface)
(no doc)
typings/async-node/async-node.d.ts
LoggerStatic (Interface)
(no doc)
typings/winston/winston.d.ts
ICommandStatic (Interface)
(no doc)
typings/commander/commander.d.ts
_Linqable (Interface)
(no doc)
typings/kinq/kinq.d.ts
Request (Interface)
(no doc)
typings/express/express.d.ts
Charsets (Interface)
(no doc)
typings/mime/mime.d.ts

Core symbols most depended-on inside this repo

on
called by 72
typings/node/node.d.ts
option
called by 29
typings/commander/commander.d.ts
pipe
called by 29
typings/node/node.d.ts
dispose
called by 27
typings/node/node.d.ts
toString
called by 25
typings/node/node.d.ts
update
called by 18
typings/node/node.d.ts
unref
called by 17
typings/node/node.d.ts
writeAsync
called by 16
typings/node/node.d.ts

Shape

Method 383
Interface 141
Class 82
Function 51
Enum 9

Languages

TypeScript100%

Modules by API surface

typings/node/node.d.ts272 symbols
typings/express/express.d.ts69 symbols
typings/kinq/kinq.d.ts55 symbols
typings/winston/winston.d.ts52 symbols
typings/mocha/mocha.d.ts52 symbols
typings/commander/commander.d.ts34 symbols
server/management/userController.ts10 symbols
lib/chacha20.ts10 symbols
server/server.ts9 symbols
server/app.ts7 symbols
client/socks5/localProxyServer.ts7 symbols
lib/chacha20stream.ts6 symbols

For agents

$ claude mcp add LightSword \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact