白名单机制的本地HTTPS反向代理,可对HTTPS请求的SNI进行修改或去除以突破互联网审查
修复因DNS污染,SNI阻断导致的访问问题
已默认添加
可在配置文件中添加更多网站
安装ssl根证书
证书文件ca.crt
运行snimap
授予执行权限
以管理员方式运行
使用sudo
注意此时的配置文件在root用户目录内
或者使用setcap
授予更小粒度的权限 (capabilities)
$ sudo setcap 'cap_dac_override+ep cap_net_bind_service=+ep' ./target/release/snimap
完成后即可用非root用户运行
配置文件位置
${config_dir}/snimap/config.toml
Platform | Value | Example |
---|---|---|
Linux | $XDG_CONFIG_HOME or $HOME /.config |
/home/alice/.config |
macOS | $HOME /Library/Application Support |
/Users/Alice/Library/Application Support |
Windows | {FOLDERID_RoamingAppData} |
C:\Users\Alice\AppData\Roaming |
配置文件格式
相关代码
enable
和enable_sni
默认为true
#[derive(Deserialize, Serialize)]
pub struct Config {
enable: Option<bool>,
enable_sni: Option<bool>,
groups: Vec<Group>,
}
#[derive(Deserialize, Serialize)]
pub struct Group {
enable: Option<bool>,
enable_sni: Option<bool>,
name: String,
sni: Option<String>,
mappings: Vec<Mapping>,
}
#[derive(Deserialize, Serialize)]
pub struct Mapping {
enable: Option<bool>,
enable_sni: Option<bool>,
hostname: String,
sni: Option<String>,
}
Example
[[groups]]
name = "Duckduckgo"
[[groups.mappings]]
hostname = "duckduckgo.com"
[[groups]]
enable_sni = false
name = "Wikipedia"
[[groups.mappings]]
hostname = "zh.wikipedia.org"
[[groups]]
name = "Pixiv"
[[groups.mappings]]
hostname = "pixiv.net"
sni = "www.fanbox.cc"
On OpenSUSE
$ git clone [email protected]:shanmiteko/snimap.git --depth=1
$ sudo zypper install libopenssl-devel
$ cargo build --release
$ sudo zypper install ibcap2 libcap-progs
$ sudo setcap 'cap_dac_override+ep cap_net_bind_service=+ep' ./target/release/snimap
$ cargo run --release