Skip to content

Instantly share code, notes, and snippets.

View phlinhng's full-sized avatar

phlinhng

  • Tsinghua University
  • Formosa
View GitHub Profile
@phlinhng
phlinhng / v2ray-unblock-netflix.md
Last active February 22, 2024 07:33
利用 v2ray-core / xray-core 的任意門協議解鎖流媒體

V2Ray 白話文教學介紹了如何利用 V2Ray 的路由功能將特定網站(例如 Netflix)的流量經過 Shadowsocks 轉到另一台機器上,達成解鎖流媒體的方法。 事實上,可以利用 V2Ray 的任意門協議直接將流量轉發到落地機上,進一步減少使用代理協議產生的開銷,以下為做法。

假設不能看奈飛的機器為 VPS A,可以看奈飛的機器為 VPS B。

基本配置

  • VPS A: 開兩個 freedom outbound,一個給 80 端口,一個給 443 端口,並配置對應的路由規則
  • VPS B: 開兩個 dokodemo-door inbound,一個給 80 端口,一個給 443 端口,兩個 inbound 都要設置 sniffing,並配置對應的路由規則

VPS A 設置

{
  "outbounds": [
@phlinhng
phlinhng / a-trojan-with-nginx-stream-module.md
Last active March 28, 2024 13:39
Trojan + NGINX 多網站共存

利用 NGINX 的 Stream 模塊 sni_preread 功能,可以做到讓 Trojan 和其他網站在同一台機器上共享 443 端口。

@phlinhng
phlinhng / clash.yaml
Last active October 31, 2023 08:46
clash 1.0+ 配置模版
# HTTP, SOCKS5 混合端口
mixed-port: 7890
# 允许局域网的连接(可用来共享代理)
allow-lan: true
# 规则模式:Rule(规则) / Global(全局代理)/ Direct(全局直连)
mode: Rule
# 设置日志输出级别 (默认级别:info,级别越高日志输出量越大,越倾向于调试)
@phlinhng
phlinhng / go-to-fhs.md
Created August 16, 2020 13:52
V2Ray 从原有 go.sh 遷移至 install-realese.sh 教程
  1. 转移配置文件目录至新目录 /usr/local/etc/v2ray
mkdir -p /usr/local/etc/v2ray
mv /etc/v2ray/config.json /usr/local/etc/v2ray/config.json
  1. 移除旧脚本安装的 v2ray-core(由于旧脚本停用,只能手动移除)
systemctl stop v2ray
systemctl disable v2ray
rm -f /etc/systemd/system/v2ray.service
@phlinhng
phlinhng / Caddyfile
Last active June 18, 2023 14:19
caddy 簡單反代谷歌學術
scholar.example.com {
timeouts 5m
proxy / https://scholar.google.com.hk {
except /robots.txt /usercontent
header_upstream X-Real-IP {remote}
header_upstream X-Forwarded-For {remote}
header_upstream User-Agent {>User-Agent}
# header_upstream X-Real-IP {>CF-Connecting-IP}
# header_upstream X-Forwarded-For {>CF-Connecting-IP}
header_upstream Accept-Language zh-HK
@phlinhng
phlinhng / soga.conf
Last active January 29, 2023 10:48
soga v2ray + nginx 反代
type=v2board # 必填这个
server_type=v2ray # 必填这个
api=webapi # webapi 或 db,表示 webapi 对接或数据库对接
# webapi 对接
webapi_url=https://www.yourdomain.com/ # webapi url,填写面板主页地址
webapi_key= # webapi key
node_id=1 # 节点id
soga_key= # 授权key,社区版无需填写,最多支持88用户,商业版无限制
@phlinhng
phlinhng / http.conf
Last active July 5, 2020 00:02
v2board + nginx (path: /etc/nginx/sites-enabled/v2board.conf)
server {
listen 80;
listen [::]:80;
root /var/www/v2board/public; # 改成你自己的路径
index index.php index.html;
server_name sspanel.host; # 改成你自己的域名
location / {
try_files $uri $uri/ /index.php$is_args$query_string;
}
@phlinhng
phlinhng / cloudflare_optimise.md
Last active March 5, 2021 01:34
Cloudflare 三网优化节点测试结果 (2020.04)

Cloudflare 三網優化

移動友好

172.64.32.0/24 (香港)

聯通友好

172.69.72.0/22 (澳門)
172.64.0.0/13 (美國 聖何塞)

電信友好

@phlinhng
phlinhng / copy_cert.sh
Last active June 27, 2020 08:52
scp ssl cert files to other servers
#!/bin/bash
site="www.your-ssl.com"
path="/root/.acme.sh/acme-v02.api.letsencrypt.org/sites/${site}"
touch server.key server.crt
sudo cat "${path}/${site}.key" > "/root/server.key"
sudo cat "${path}/${site}.crt" > "/root/server.crt"
if [ -s "server.key" ] && [ -s "server.crt" ]; then
@phlinhng
phlinhng / Caddyfile
Last active June 19, 2021 06:49
trojan-go with caddy as remote web server & https redirector
must.have.sni.com:80 {
redir https://must.have.sni.com{uri}
}
must.have.sni.com:8080 {
bind 127.0.0.1
root /var/www/html
index index.html
tls off
}