ArchLinux搭建Hysteria2科学上网
  • 然后需要一个域名,将域名解析到服务器的IP,这里我选择用vpn.trystduy.top,我推荐将域名托管到cloudflare,不过在腾讯云有详细的教程,对小白很友好
  • 连接到服务器,现在开始安装Hysteria2服务端,这里只介绍ArchLinux的搭建方式,别的常见的 Linux 发行版可以查看Hysteria2的官方中文文档
# ArchLinux服务器
pacman -S hysteria #选第一个
  • 创建配置文件,注释处可以自行修改
nano /etc/hysteria/config.yaml
#写入下面内容
###########开始############
listen: :1111  # 端口

acme:
  domains:
    - vpn.trystudy.top  # 域名
  email: trystudy@trystudy.top  # 邮箱

auth:
  type: password
  password: TryStudy  # 密码

masquerade:
  type: proxy
  proxy:
    url: https://bing.com/  
    rewriteHost: true
###########结束############
  • 配置systemd 服务,设置开机自启
nano /etc/systemd/system/hysteria-server.service
#写入下面内容
###########开始############
[Unit]
Description=Hysteria Server
After=NetworkManager.service

[Service]
Type=simple
ExecStartPre=/bin/sleep 3
ExecStart=hysteria server
Restart=on-failure

[Install]
WantedBy=multi-user.target
###########结束############
# 开启服务并设置开机自启
systemctl enable --now hysteria-server
  • 现在回到自己需要连接节点的设备
  • 至于在没有科学上网的情况下怎么访问GitHub,可以自行百度搜素
  • 下面是一个Clash的本地配置文件,修改一下自己的信息,配置好保存后缀为“.yaml”的文件
mixed-port: 7890
allow-lan: true
log-level: silent
mode: rule
external-controller: '127.0.0.1:9090'
unified-delay: true
tun:
    mtu: 1500
dns:
  enable: true
  ipv6: false
  listen: 0.0.0.0:7874
  default-nameserver:
    - 8.8.8.8
    - 8.8.4.4
  enhanced-mode: fake-ip
  nameserver:
    - 8.8.8.8
    - 8.8.4.4
    - 223.5.5.5
    - 180.76.76.76
    - 119.29.29.29
    - 117.50.11.11
    - 117.50.10.10
    - 114.114.114.114
    - https://dns.alidns.com/dns-query
    - https://doh.360.cn/dns-query
  fallback:
    - 1.1.1.1
    - 1.0.0.1
    - 8.8.8.8
    - tls://dns.rubyfish.cn:853
    - tls://1.0.0.1:853
    - tls://dns.google:853
    - https://dns.rubyfish.cn/dns-query
    - https://cloudflare-dns.com/dns-query
    - https://dns.google/dns-query
  fallback-filter:
    geoip: true
    ipcidr:
      - 240.0.0.0/4
      - 0.0.0.0/32
      - 127.0.0.1/32
    domain:
      - +.google.com
      - +.facebook.com
      - +.youtube.com
      - +.xn--ngstr-lra8j.com
      - +.google.cn
      - +.googleapis.cn
      - +.gvt1.com
proxies:
# 修改这里的设置
    - { name: TryStudy, type: hysteria2, server: vpn.trystudy.top, port: 1111,  password: TryStudy, skip-cert-verify: true }
proxy-groups:
    - { name: 'Auto', type: select, proxies: ['TryStudy'] }

# 下面的规则参考的github上Loyalsoldier的项目clash-rules
rules:
  - RULE-SET,reject,Auto
  - RULE-SET,proxy,Auto
  - RULE-SET,icloud,Auto
  - RULE-SET,private,Auto
  - RULE-SET,telegramcidr,Auto
  - RULE-SET,gfw,Auto
  - RULE-SET,tld-not-cn,DIRECT
  - RULE-SET,direct,DIRECT
  - RULE-SET,cncidr,DIRECT
  - RULE-SET,lancidr,DIRECT
  - RULE-SET,applications,DIRECT
  - RULE-SET,apple,DIRECT
  - GEOIP,CN,DIRECT
  - MATCH,Auto
rule-providers:
  reject:
    type: http
    behavior: domain
    url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/reject.txt"
    path: ./ruleset/reject.yaml
    interval: 86400

  icloud:
    type: http
    behavior: domain
    url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/icloud.txt"
    path: ./ruleset/icloud.yaml
    interval: 86400

  apple:
    type: http
    behavior: domain
    url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/apple.txt"
    path: ./ruleset/apple.yaml
    interval: 86400

  google:
    type: http
    behavior: domain
    url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/google.txt"
    path: ./ruleset/google.yaml
    interval: 86400

  proxy:
    type: http
    behavior: domain
    url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/proxy.txt"
    path: ./ruleset/proxy.yaml
    interval: 86400

  direct:
    type: http
    behavior: domain
    url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/direct.txt"
    path: ./ruleset/direct.yaml
    interval: 86400

  private:
    type: http
    behavior: domain
    url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/private.txt"
    path: ./ruleset/private.yaml
    interval: 86400

  gfw:
    type: http
    behavior: domain
    url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/gfw.txt"
    path: ./ruleset/gfw.yaml
    interval: 86400

  tld-not-cn:
    type: http
    behavior: domain
    url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/tld-not-cn.txt"
    path: ./ruleset/tld-not-cn.yaml
    interval: 86400

  telegramcidr:
    type: http
    behavior: ipcidr
    url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/telegramcidr.txt"
    path: ./ruleset/telegramcidr.yaml
    interval: 86400

  cncidr:
    type: http
    behavior: ipcidr
    url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/cncidr.txt"
    path: ./ruleset/cncidr.yaml
    interval: 86400

  lancidr:
    type: http
    behavior: ipcidr
    url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/lancidr.txt"
    path: ./ruleset/lancidr.yaml
    interval: 86400

  applications:
    type: http
    behavior: classical
    url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/applications.txt"
    path: ./ruleset/applications.yaml
    interval: 86400
  • 然后在Clash订阅界面点击新建,类型选择Local,文件选择刚刚的配置文件
  • 该客户端仅适用于MacOS,Linux,Windows,该客户端的tun模式可以实现真正的全局代理,个人认为是我用过所有代理工具中最好用的
暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇