转载:Windows下三分钟搭建Shadowoscks服务器端

时间:2023-03-08 21:41:16

Windows下三分钟搭建Shadowoscks服务器端

之前在V2EX上有人问为啥没人做个在Windows上一键运行*服务器端的程序,我只想说……这是因为没人关注我的libQt*项目啊!(脑补暴走漫画表情)

所以本文要来告诉这些想要帮别人的“小白”,轻轻松松只要三分钟,无痛@#@%#*(什么鬼?)让*服务端在你的Windows机器上跑起来!不用自己编译,不用安装什么Python、.Net的。

先上步骤,内情在后面再叙。

  1. 下载最新的*-libqss(Fedora下软件包名为*-libQt*)
  2. 准备好config.json文件(范例文件点此,点Raw另存为config.json就能下载下来了),server字段填写”0.0.0.0″(如果走IPv6线路,填”::”),加密方式可以改成更新潮的”chacha20″(老旧的*客户端可能不支持chacha20加密)
  3. 要*-libqss.exe以server mode运行需要加上-S参数,你可以从命令行提示符去运行。或者,更简单的,用我写好的bat脚本(点此查看,点Raw按钮另存为bat脚本即可)
  4. 将*-server.bat与*-libqss.exe, config.json放在同一个文件夹下,执行*-server.bat即可

停止运行?关掉就可以了。下次再运行?执行*-server.bat脚本就好了。修改配置文件?别用自带的记事本和写字板,去下载一个Notepad++吧,免得格式乱套了。

“内情”

使用的这个程序*-libqss本身是libQt*项目的一部分,最初始的目的是演示如何在Qt程序里调用libQt*,后来则成为一个命令行式的客户端/服务端了。因为本身libQt*就兼具客户端和服务端的功能,两者的区别很不大,如果拆成两个程序反而奇怪。

所以默认情况下*-libqss会读取当前文件夹下的config.json文件,并以客户端模式启动。使用-c可以指定配置文件,而-S参数则使其以服务端模式运行。

配置文件config.json的格式和其他*版本一样,双向兼容~~(说了无痛>.<)

简单说一下相比其他文章提到的其他版本,*-libqss的优势在哪里吧。*-libev在Windows下编译比较麻烦,如果你下载第三方编译的版本,总是有点不放心不是?(当然,你下载的是我编译的*-libqss,如果你不放心就别下拉倒)。*-go已经很久没有实质更新了。*-csharp-server支持的加密方式很少而且依赖.Net…主线的python版本依赖Python环境,而且要支持Salsa20和ChaCha20的话还要装libsodium,值得注意的还有*-libqss的CPU、内存占用小。

若有侵权,请联系删除

原文来源:https://www.librehat.com/three-minutes-to-set-up-*-server-on-windows/

===============================

config.json 配置示例

{
"server":"my_server_ip",
"server_port":8388,
"local_port":1080,
"password":"barfoo!",
"timeout":600,
"method":"chacha20-ietf-poly1305"
}

配置说明:

  • server: your hostname or server IP (IPv4/IPv6).
  • server_port: server port number.
  • local_port: local port number.
  • password: a password used to encrypt transfer.
  • timeout: connections timeout in seconds.
  • method: encryption method.

Encryption Method

The strongest option is an AEAD cipher. The recommended choice is "chacha20-ietf-poly1305" or "aes-256-gcm". Other stream ciphers are implemented but do not provide integrity and authenticity. Unless otherwise specified the encryption method defaults to "table", which is not secure.

Stream Ciphers

Stream ciphers provide only confidentiality. Data integrity and authenticity is not guaranteed. Users should use AEAD ciphers whenever possible.

The following stream ciphers provide reasonable confidentiality.

Name Key Size IV Length
aes-128-ctr 16 16
aes-192-ctr 24 16
aes-256-ctr 32 16
aes-128-cfb 16 16
aes-192-cfb 24 16
aes-256-cfb 32 16
camellia-128-cfb 16 16
camellia-192-cfb 24 16
camellia-256-cfb 32 16
chacha20-ietf 32 12

The following stream ciphers have inherent weaknesses (see discussion at #36). DO NOT USE. Implementors are advised to remove them as soon as possible.

Name Key Size IV Length
bf-cfb 16 8
chacha20 32 8
salsa20 32 8
rc4-md5 16 16