为什么要在上Windows搭建,因为我要用。
๑乛◡乛๑
域名:
Trojan
下载地址:https://github.com/trojan-gfw/trojan
配置指南:https://trojan-gfw.github.io/trojan
用Trojan-go也是一样的,这里就不放配置了。
(我这里的config.json不适合所有人,请自行理解修改)
{
"run_type": "server",
"local_addr": "0.0.0.0",
"local_port": 233,
"remote_addr": "192.168.1.1",
"remote_port": 3070,
"password": [
"password1",
"password2" //用不同的密码区分用户,在log里可以查看
],
"log_level": 1,
"ssl": {
"cert": "D:/cert.pem", //TLS证书路径
"key": "D:/privkey.pem", //TLS私钥路径
"key_password": "",
"cipher": "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384",
"cipher_tls13": "TLS_AES_128_GCM_SHA256:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_256_GCM_SHA384",
"prefer_server_cipher": true,
"alpn": [
"http/1.1"
],
"alpn_port_override": {
"h2": 81
},
"reuse_session": true,
"session_ticket": false,
"session_timeout": 600,
"plain_http_response": "",
"curves": "",
"dhparam": ""
},
"tcp": {
"prefer_ipv4": true, //我是prefer的
"no_delay": true,
"keep_alive": true,
"reuse_port": false,
"fast_open": false,
"fast_open_qlen": 20
},
"mysql": {
"enabled": false,
"server_addr": "127.0.0.1",
"server_port": 3306,
"database": "trojan",
"username": "trojan",
"password": "",
"key": "",
"cert": "",
"ca": ""
}
}
写个bat文件,双击之后就可以后台运行了,不用看着烦人的黑底白字的窗口。
(这个是会生成log文件的,不想生成就去掉 -l D:/Log.log 这部分代码)
@echo off
if "%1"=="h" goto begin
start mshta vbscript:createobject("wscript.shell").run("""%~nx0"" h",0)(window.close)&&exit
:begin
D:/trojan -l D:/Log.log D:/config.json
想在窗口里看log的话就这么写:
@echo off
D:/trojan D:/config.json
当然,如果后台运行,改了配置是要重新启动的,以下是关闭trojan的bat,双击就能用。
@echo off
if "%1" == "h" goto begin
mshta vbscript:createobject("wscript.shell").run("%~nx0 h",0)(window.close)&&exit
:begin
taskkill /f /t /im trojan.exe
根据后面的需要,这里可以直接关闭三个程序:
taskkill /f /t /im trojan.exe & taskkill /f /t /im mtg.exe & taskkill /f /t /im sniproxy.exe
SET CGO_ENABLED=0SET GOOS=windowsSET GOARCH=amd64go build main.go
https://t.me/proxy?server=b.hahaha.com&port=443&secret=7oUjgPNioJND77RpDE4Xhi5nb29nbGUuY29t
@echo offif "%1"=="h" goto beginstart mshta vbscript:createobject("wscript.shell").run("""%~nx0"" h",0)(window.close)&&exit:beginD:/trojan/mtg run -b 0.0.0.0:2333 --cloak-port=443ee852380f362a09343efb4690c4e17862e676f6f676c652e636f6d
想在窗口里看的话就这么写:
@echo off
D:/trojan/mtg run -b 0.0.0.0:2333 --cloak-port=443ee852380f362a09343efb4690c4e17862e676f6f676c652e636f6d
SNIPROXY
下载地址:https://github.com/atenart/sniproxy
SET CGO_ENABLED=0SET GOOS=windowsSET GOARCH=amd64 //这三句之前没动过的话就不用再输入了go build main.go
他会提示:
# command-line-arguments
.\main.go:34:8: undefined: Proxy
然后你运行:
go build
就会发现它说:
proxy.go:26:2: cannot find package "github.com/atenart/sniproxy/config" in any of:
c:\go\src\github.com\atenart\sniproxy\config (from $GOROOT)
C:\Users\userA\go\src\github.com\atenart\sniproxy\config (from $GOPATH)
因为GOROOT和GOPATH路径下没这个package,我懒得改环境,就直接复制过去吧:
md C:\Users\userA\go\src\github.com\atenart\sniproxy\config
xcopy D:\sniproxy\config C:\Users\userA\go\src\github.com\atenart\sniproxy\config /e
D:\sniproxy\config\config.goD:\sniproxy\config\lexer.goD:\sniproxy\config\parser.go复制了 3 个文件
go build
a.hahaha.com {backend 127.0.0.1:233}google.com {backend 127.0.0.1:2333}
@echo offif "%1"=="h" goto beginstart mshta vbscript:createobject("wscript.shell").run("""%~nx0"" h",0)(window.close)&&exit:beginD:/Tro/sniproxy-bind 0.0.0.0:443 -conf D:/Tro/sniproxy.conf>> D:\SNILog.log 2>&1
@echo offD:/Tro/sniproxy-bind 0.0.0.0:443 -conf D:/Tro/sniproxy.conf
没有评论:
发表评论