Board logo

標題: 【Raspberry Pi + V2Ray】—— 翻墙懒人包!在大陆可以看到香港新闻、用到WhatsApp、Facebook、YouTube [打印本頁]

作者: 角色    時間: 2019-2-6 15:07     標題: 【Raspberry Pi + V2Ray】—— 翻墙懒人包!在大陆可以看到香港新闻、用到WhatsApp、Facebook、YouTube

本帖最後由 角色 於 2019-3-10 16:53 編輯

最新Jump starter package可以让members下载, Link

------------------------------------------------------
因为有不少香港人准备或者已经在大陆工作的members,估计他们一定需要看香港新闻、看Whatsapp、Facebook和YouTube等等。坊间有不少的方法,例如

1)香港购买漫游卡、
2)或者购买VPN服务、
3)用免费的VPN软件、
4)mod机安装V2Ray,
5)家里的NAS有Virtualisation Station,
6)家里安装电脑run V2Ray,
7)或者购买海外VPS安装V2Ray这样的服务器等等不同方式,
8)就是家里安装一个Raspberry Pi + V2Ray server。

前面三种方式不太适合长期在大陆工作的members,经常突然间VPN就不能工作,而第四种mod机,估计也有不少人做过这样方式,例如安装OpenWRT+其他package,或者其他third-party firmwares,mod机分分钟把router mod死;第5、6种都大有人在,但是成本比较高;第七种就是购买海外的VPS,这个有它的好处,就是不需要硬件的维护,但是要收费,每年大约是300-500元之前,但是也可以用暂时免费的谷歌云。

现在本帖介绍第8种的低成本的Raspberry Pi (现在已经是3b+版本)了,整个费用大约是400港元附近。Raspberry Pi可以安装非常多的软件,例如现在比较常用的V2Ray。

[attach]4287[/attach]

上面描述,如果家里安装好V2Ray server后,在大陆就可以用BifrostV App(Android)或iPhone安装Shadowrockets就可以连接香港的V2Ray server。一个V2Ray account可以多个devices同时使用,非常方便。

Raspberry Pi 3b+ 购买信息 Link,如果Raspberry Pi 3b+在香港RS买大约300元,而MicroSD card大约30元,再加上外壳(在大陆买便宜)整个加起来才400元附近,那么在大陆工作的member就有自己的V2Ray server可以独享,十分经济。

关于V2Ray 基本原理 可以参考下面帖子:
《Project V:入學編》
《V2Ray User‘s Guide 使用手册》


有很多关于Raspberry Pi的信息,可以看Raspberry的portal
http://www.telecom-cafe.com/foru ... &extra=page%3D1
作者: 角色    時間: 2019-2-6 15:08

本帖最後由 角色 於 2019-3-4 21:50 編輯

希望有兴趣人士去download,再修改部分参数。

1、购买Raspberry Pi3b+ 和有关setup设备 Link

2、Download rpi_v2ray_x.xx.zip Link

3、用Etcher 把下载直接rpi_v2ray_x.xx.zip写入MicroSD card(不需要解压) Link

4、用nano修改static ip address for the LAN port, default,Raspberry Pi LAN port IP address=192.168.55.22,gateway=192.168.55.1,nameservers=192.168.55.1,8.8.8.8
  1. sudo nano /etc/dhcpcd.conf
複製代碼
,
  1. # Example static IP configuration:
  2. interface eth0
  3. static ip_address=192.168.55.22/24
  4. static routers=192.168.55.1
  5. static domain_name_servers=192.168.55.1 8.8.8.8
複製代碼
.

If your Raspberry Pi LAN address= 192.168.1.100, gateway=192.168.1.1, nameservers=192.168.1.1, 8.8.8.8, then as follows:
  1. # Example static IP configuration:
  2. interface eth0
  3. static ip_address=192.168.1.100/24
  4. static routers=192.168.1.1
  5. static domain_name_servers=192.168.1.1 8.8.8.8
複製代碼
.

Using the following command to reload the above parameters without reboot
  1. systemctl restart dhcpcd
複製代碼
.

Check the interface eth0 if it has the new ip address of 192.168.1.100,gateway=192.168.1.1
  1. ip add
複製代碼
.

5. 输入下面指令,看看cat /etc/v2ray/config.json里的port number(line 04) 和 UUID(line09)
  1. root@raspberrypi:~# cat /etc/v2ray/config.json
  2. {
  3.   "inbounds": [{
  4.     "port": 22905,
  5.     "protocol": "vmess",
  6.     "settings": {
  7.       "clients": [
  8.         {
  9.           "id": "5668a2b4-ddad-4f36-8792-f8645c35395e",
  10.           "level": 1,
  11.           "alterId": 64
  12.         }
  13.       ]
  14.     }
  15.   }],
  16.   "outbounds": [{
  17.     "protocol": "freedom",
  18.     "settings": {}
  19.   },{
  20.     "protocol": "blackhole",
  21.     "settings": {},
  22.     "tag": "blocked"
  23.   }],
  24.   "routing": {
  25.     "rules": [
  26.       {
  27.         "type": "field",
  28.         "ip": ["geoip:private"],
  29.         "outboundTag": "blocked"
  30.       }
  31.     ]
  32.   }
  33. }
  34. root@raspberrypi:~#
複製代碼
.

6、改port number, 10000-60000之间 (eg,随机选一个不让别人猜到的,例如39812)

7、改UUID, 可以点击 Link,去generate一个新的。

8、修改 /etc/v2ray/config.json,用nano command,把上面新的port number和UUID填上去
  1. sudo nano /etc/v2ray/config.json
複製代碼


9、改Router的port forward TCP port 39812 to你的Raspberry LAN port address,在这里例子是192.168.1.100

10、reboot Raspberry pi

11、用BifrostV安装 (主机:你的Router WAN hostname or IP,端口:39812,用户ID=UUID,AlterID=64),其他default。

12、check延迟(如果有xxxxms)说起你的服务器可以用。(不连接Proxy,在BifrostV首页,点击右上角的三点,然后弹出延迟测试)
作者: 角色    時間: 2019-2-6 15:08

本帖最後由 角色 於 2019-3-8 09:57 編輯

Collection of V2Ray Jump Starters

rpi_v2ray_v4.15.zip Link
rpi_v2ray_v4.16.zip Link
rpi_v2ray_v4.18.zip Link
作者: 角色    時間: 2019-2-6 15:08

本帖最後由 角色 於 2019-3-8 10:02 編輯

Procedures for making jump starter for V2Ray server (for internal use only)

1. Mount QNAP drive
http://www.telecom-cafe.com/foru ... &extra=page%3D1

2. Copy SD card, shrink, and zip file for distribution
http://www.telecom-cafe.com/foru ... &extra=page%3D1

3. Install v2ray via proxy curl command
http://www.telecom-cafe.com/foru ... &extra=page%3D1
作者: 角色    時間: 2019-2-6 15:08

备用帖子5
作者: 角色    時間: 2019-2-6 15:09

备用帖子6
作者: 角色    時間: 2019-2-6 15:09

备用帖子7
作者: 角色    時間: 2019-2-6 15:10

备用帖子8
作者: 角色    時間: 2019-2-6 15:10

备用帖子9
作者: 角色    時間: 2019-2-6 15:12

备用帖子10
作者: 角色    時間: 2019-2-6 15:12

备用帖子11
作者: 角色    時間: 2019-2-6 15:13

备用帖子12
作者: 角色    時間: 2019-2-6 15:13

备用帖子13
作者: 角色    時間: 2019-2-6 15:13

备用帖子14
作者: 角色    時間: 2019-2-6 15:14

备用帖子15
作者: 角色    時間: 2019-2-13 22:21

本帖最後由 角色 於 2019-2-15 19:37 編輯

Jump Starter for V2ray Server using Raspberry Pi 3b+

Dropbox download link:
https://www.dropbox.com/s/ysewjm ... 2ray_v4.15.zip?dl=0

Features:
V2Ray version 4.15
sshd enabled

Errata:
1、在/etc/dhdcpcd.conf里的”# interface eth0”,应该为“interface eth0”,但是不影响功能,修改时可以把“#”号去掉。
作者: 角色    時間: 2019-2-15 19:37

本帖最後由 角色 於 2019-2-16 15:00 編輯

Jump Starter for V2ray Server using Raspberry Pi 3b+

Features:
- V2Ray  version 4.16
- applied the most update and upgrade packages

Dropbox download link:
https://www.dropbox.com/s/0aa5hf ... 2ray_v4.16.zip?dl=0
作者: 角色    時間: 2019-3-6 16:09

因为香港人要吃“快餐”,所以我做了这个懒人包,有兴趣的members,可以按照我这幅帖子的内容购买Raspberry Pi 3b+,然后下载“懒人包”,再改一下参数就搞定!!!那么你就可以大陆看香港新闻,看看Facebook,WhatsApp,YouTube等等。

如果你在安装上遇到什么问题,可以跟帖讨论。如果你的账号还在审批中,你可以给我PM,我会跟坛主说一下。
作者: 角色    時間: 2019-3-8 09:55

Jump Starter for V2ray Server using Raspberry Pi 3b+

File name: rpi_v2ray_v4.18.zip

Dropbox download link:
https://www.dropbox.com/s/p0a2u4 ... 2ray_v4.18.zip?dl=0

Features:
- V2Ray  version 4.18
- applied the most update and upgrade packages
- change the Raspbian and Debian sources from China to Singapore
作者: slemon    時間: 2019-3-21 16:06

回復 19# 角色
可否做到WS +TLS?  我裝梅林V2ray 基本。開始有斷線和被Qos現象。  Thanks.
作者: 角色    時間: 2019-3-22 16:31

本帖最後由 角色 於 2019-3-22 16:33 編輯

因为我没有架设网站的经验,所以还在学习中,不过我会朝着这个目标走!就如Kingwilliam那样,他已经写了不少的帖子关于这方面,你可以参考一下。

还有这个是懒人包,弄得比较简单一点,不然新的members不太会用。
作者: kingwilliam    時間: 2019-3-22 17:13

回復 20# slemon

C hing 你梅林是server定client? 想如何設定 可一齊研究。
作者: slemon    時間: 2019-3-22 18:54

回復 22# kingwilliam
我用梅林做Server.  跟著企業號首3頁設定的。很簡單。之前都穩定的,現在有時會被封。要轉IP.
作者: kingwilliam    時間: 2019-3-22 19:30

本帖最後由 kingwilliam 於 2019-3-22 21:19 編輯

回復 23# slemon

c hing 以下代碼是server side ws+tls config 給參考, cert.crt and cert.key 就是證書和密匙.

domain :
最好有一個 domain, 退一步 dyndns, no-ip 都可以.

certificate :
- 證書可以用 Let's Encrypt, 可到 SSL For Free 申請, 如真的不能提供 http / ftp. 可退一步用self sign cert.
- cert.crt and cert.key 可放到/etc/v2ray/ folder, 即config.json同一個folder

self sign cert :
可到以下 網址 參考

Remarks :
如用merlin, 建議準備 u盘 (8g已可以), 用作 swap
參考 網址

server side ws+tls config
  1. //ws-tls main port 443
  2. {
  3.         "protocol": "vmess",
  4.         "port": 443,
  5.         "settings": {
  6.                 "clients": [
  7.                         {
  8.                                 "id": "id",
  9.                                 "alterId": 64
  10.                         }
  11.                 ]
  12.         },
  13.         "streamSettings": {
  14.                 "network": "ws",
  15.                 "wsSettings": {
  16.                         "path": "/vpath2/"
  17.                 },
  18.                 "security": "tls",
  19.                 "tlsSettings": {
  20.                         "certificates": [
  21.                                 {
  22.                                         "certificateFile": "/etc/v2ray/cert.crt",
  23.                                         "keyFile": "/etc/v2ray/cert.key"
  24.                                 }
  25.                         ]
  26.                 }
  27.         }
  28. }
複製代碼

作者: slemon    時間: 2019-3-23 11:34

回復 24# kingwilliam
師兄,用咗Let's Encrypt Cert., 改咗config.json.  整個V2ray load唔起。Reboot, 改回原本設定都唔得。結果整個V2ray 要重裝。未知原因 XD.
作者: kingwilliam    時間: 2019-3-23 11:37

回復 25# slemon


    有冇有試過 v2ray -test, 有沒有error. 或可否post config.json 上來一齊研究(記得先清除 id)
作者: slemon    時間: 2019-3-23 11:59

回復 26# kingwilliam
V2ray load完,正常Error log 會記寫V2ray started.  但改完, reboot 和 load V2ray,Error log 和 access log files 都消失咗.  出咗街,遲D一步步試。Thanks.
作者: slemon    時間: 2019-3-23 23:50

回復 26# kingwilliam
師兄,我用這個config.json.  請幫忙睇睇,Let's Encrypt是梅林DDNS自設更新的。 謝謝!
"log" : {
    "access": "/var/log/v2ray/access.log",
    "error": "/var/log/v2ray/error.log",
    "loglevel": "warning"
  },
  "inbound": {
    "port": 443,
    "protocol": "vmess",
    "settings": {
      "clients": [
        {
          "id": "user1 id",
          "level": 1,
          "alterId": 64
        },
        {
          "id": "user2 id",
          "alterId": 64
        },
        {
          "id": "user3 id",
          "alterId": 64
        },
        {
          "id": "user4 id",
          "alterId": 64
        }
      ]
    },
    "streamSettings": {
       "network": "ws"
       "wsSettings": {
          "path": "/jffs"
                },
       "security": "tls",
       "tlsSettings": {
          "certificates": [
                {
                 "certificateFile": "/jffs/.le/xxxxx.asuscomm.com/cert.pem",
                 "keyFile": "/jffs/.le/xxxxx.asuscomm.com/domain.key"
                }
              ]
            }
          }
  },
  "outbound": {
    "protocol": "freedom",
    "settings": {}
  },
  "outboundDetour": [
    {
      "protocol": "blackhole",
      "settings": {},
      "tag": "blocked"
    }
  ],
  "routing": {
    "strategy": "rules",
    "settings": {
      "rules": [
        {
          "type": "field",
          "ip": [
            "0.0.0.0/8",
            "10.0.0.0/8",
            "100.64.0.0/10",
            "127.0.0.0/8",
            "169.254.0.0/16",
            "172.16.0.0/12",
            "192.0.0.0/24",
            "192.0.2.0/24",
            "198.18.0.0/15",
            "198.51.100.0/24",
            "203.0.113.0/24",
            "::1/128",
            "fc00::/7",
            "fe80::/10"
          ],
          "outboundTag": "blocked"
        }
      ]
    }
  }
}
作者: kingwilliam    時間: 2019-3-23 23:54

本帖最後由 kingwilliam 於 2019-3-24 06:36 編輯

回復 28# slemon
  1. "streamSettings": {
  2.        "network": "ws"
  3.        "wsSettings": {
複製代碼
"ws" 後小了 "豆號"  加後試試正常否
  1. "streamSettings": {
  2.        "network": "ws",
  3.        "wsSettings": {
複製代碼

作者: 角色    時間: 2019-3-24 00:02

不知道效果怎眼?
作者: slemon    時間: 2019-3-24 00:25

回復 29# kingwilliam
師兄,Thank You!都係唔得。。。
作者: kingwilliam    時間: 2019-3-24 06:32

本帖最後由 kingwilliam 於 2019-3-24 06:41 編輯

回復 31# slemon
  1.    "log" : {
  2.       "access": "/var/log/v2ray/access.log",
  3.       "error": "/var/log/v2ray/error.log",
  4.       "loglevel": "warning"
  5.    },
複製代碼
第一行, 少了一個 {
  1. {
  2.    "log" : {
  3.       "access": "/var/log/v2ray/access.log",
  4.       "error": "/var/log/v2ray/error.log",
  5.       "loglevel": "warning"
  6.    },
複製代碼
如果還是不行, 就要行以下指令, 再post個error看看
  1. /jffs/v2ray/v2ray -test --config=/jffs/v2ray/config.json
複製代碼

作者: slemon    時間: 2019-3-24 09:29

本帖最後由 slemon 於 2019-3-24 09:39 編輯

回復 32# kingwilliam
師兄,今早再重新設定一次,成功了 XD 感謝!! 係香港試咗沒有問題,明天入牆測試再報告。
另外,我也想知師兄用那個config?  謝謝分享。
作者: kingwilliam    時間: 2019-3-24 10:10

回復 33# slemon


config 都係 ws+tls+web
作者: slemon    時間: 2019-3-24 11:05

回復 34# kingwilliam
師兄,你好勁呀!用這個WS + TLS,穩定嗎?有沒有封IP或者限流? 還有其他後備方案嗎? 我自己有兩個梅林Server 加 大中華電話分享  XD
作者: kingwilliam    時間: 2019-3-24 13:04

本帖最後由 kingwilliam 於 2019-3-24 17:55 編輯

回復 35# slemon


    c hing 抬舉啦, 一齊研究。

問:用這個WS + TLS,穩定嗎?
答:穩定

問:有沒有封IP或者限流?
答:用了半年,還沒有封。限流,也沒有。

問:還有其他後備方案嗎?
答:vpn(如:wireguard, openvpn, pptp). 也不可以說是後備,因v2ray是proxy, 和vpn是兩樣不同用途。

下面的文章相信很多c hing都有看過,需是2018年尾選寫,但也表達出翻牆的 無奈。
墙与梯的较量 —— 那些年我们一起用过的翻墙手段
作者: 角色    時間: 2019-3-24 13:24

本帖最後由 角色 於 2019-3-24 13:37 編輯

回復 36# kingwilliam

CHing,

你说的ws + tls,是否需要架设一个website呢?

还是需要架设wesbite,变成ws + tls + web呢?
作者: kingwilliam    時間: 2019-3-24 17:31

回復 37# 角色

Websocket + tls 不用架設網站

如果 websocket + tls + web 這個就要網站
這個 彩蛋 可參考一下
作者: slemon    時間: 2019-3-24 22:07

回復 36# kingwilliam
已經入牆測試,試用中,不錯的。再次感謝師兄!!
作者: 角色    時間: 2019-3-24 22:13

原来我之前家里的settings搞错了!现在V2Ray回复正常。

Sentle3440 packets, 只有4个lost,packet-lost几乎是0,效果非常好!
  1.     sent=3440 received=3436 packet-loss=0% min-rtt=359ms avg-rtt=383ms
  2.    max-rtt=980ms
複製代碼

作者: 角色    時間: 2019-3-24 22:14

回復 39# slemon

CHing 如果你家里的IP被blocked?你要怎样处理?
作者: slemon    時間: 2019-3-24 22:35

回復 41# 角色
教學都用CDN. 我自己用香港咭或者公司線,連返router, 改Router MAC address, reboot取新IP.  有時只要reboot router 也可以改IP. 睇你邊間ISP.
作者: 角色    時間: 2019-3-24 22:52

谢谢CHing的信息,我下一部就朝着你的方向走!但是我要自己gen cert,然后放入V2Ray服务端那里,跟kingwilliam CHing差不多,他好像用ws + tls + web。

明白!因为我用Routerboard,如果IP banned,我是不能直接连去香港的router,需要用V2Ray's dokodemo做port forwarding,然后就可以连回去香港的Routerboard,再运行一些script去down-and-up WAN interface,然后更改IP。

说回你用的方法,ws + tls,如果在Raspberry Pi做,估计一般members都不知道怎样去gen cert!因为cert要跟domain,而没有人的domain都不一样,所以的确有点难度。

因为我已经很多年都没有mod机,现在主要用MikroTik routers + V2Ray on Raspberry Pi比较多。
作者: slemon    時間: 2019-3-24 22:57

回復 43# 角色
KingWilliam 師兄也是用Caddy.會自動申請Cert的。網上很多教學,只係我Linux不太懂 XD 大家加油呀!
作者: 角色    時間: 2019-3-24 23:25

本帖最後由 角色 於 2019-3-25 00:38 編輯

大家互相学习,CHing如果你试用Okay,不妨把你的心得开一个post写,然后mod机一族的members参考,因为你有现成的devices,写东西比较方便。

这个网站,你写一些,我写一些,慢慢就多起来,犹如kingwilliam前段日子把透明代理example给我看看,我马上就能建立起来。我也马上我用的codes记录下来,让其他有兴趣的members参考。
作者: slemon    時間: 2019-3-25 09:32

回復 45# 角色
師兄,我也是跟住企業號設定。前5頁設定已經包括Server and Client.  如果玩WS + TLS,只要注意Let's Encrypt和KingWilliam config.json.如果大家唔明,我哋討論一下。
https://www.enterpr1se.info/2017/10/v2ray-gfw-asuswrt-merlin/
另外,我試咗一晚,WS+TLS非常穩定 XD。
作者: 角色    時間: 2019-3-25 09:41

经过你的测试,你说的组合ws + tls不错,我在努力中。。。。

现在我就是Let's Encrypt里卡住,因为Let‘s Encrypt需要用到hostname,我也有,也按照需要用sftp方式,但是估计到下载cert的是,对方的machine IP要进入local machine,要我enable,因为我前面还有好几个router,所以都不知道怎样解决到。

出现下面的信息:

SFTP Connection Failed. Please check that all fields are correct. If there is a firewall then temporarily disable it or make an exception for "67.222.10.211".

上面的IP是美国IP address,如果这一步能解决,后面应该问题不大。
作者: slemon    時間: 2019-3-25 09:50

本帖最後由 slemon 於 2019-3-25 17:26 編輯

回復 47# 角色
不是所有DDNS都支持Let's Encrypt.  比如Namecheap Domain就是不支持

這個link有用嗎?
https://youtu.be/IjL3D9km3II
作者: kingwilliam    時間: 2019-3-25 18:05

本帖最後由 kingwilliam 於 2019-3-25 18:23 編輯

回復 47# 角色

C hing, 每一層router你何admin嗎? 每層開放port 21可以嗎?

或 直接安裝  caddy, 因caddy 可自行申請letsencrypt電子證書。
作者: 角色    時間: 2019-3-25 22:16

因为PCCW家用的broadband没有开放port 80,所以我用FTP method,但是我选用了sftp方法,我还以为可以用自己定义的port,例如hostname:8xxx, router port forward to internal v2ray server port 22。谁知道对方进入如果用sftp,一定用port 22入,还有不止,还要用port 21 (ftp)(还在set)。

之前的问题
  1. SFTP Connection Failed. Please check that all fields are correct. If there is a firewall then temporarily disable it or make an exception for "67.222.10.211".
複製代碼
, 就不再出现。

还在努力中。。。。。。setup ftp server
作者: kingwilliam    時間: 2019-3-25 22:18

C hing 加油
作者: 角色    時間: 2019-3-25 23:35

I got the following error when the port 21 and 22 were suitably re-directed to the correct machine. However Let's Encrypt requires the directory being publicly accessible through port 80, which is impossible for domestic subscribers of PCCW.
  1. Server error 0. Make sure directory is publicly accessible through port 80. Turn off password protection temporarily if on. Ask your host if unsure about the directory or try using an FTP client or >web FTP if you do not have an FTP client to try finding it out.
複製代碼
.

I have to make a pause for this issue and attempt to use the self-signed certificate method.
作者: slemon    時間: 2019-3-26 00:39

回復 52# 角色
FYI
https://www.hkepc.com/forum/viewthread.php?fid=12&tid=2355051
作者: 角色    時間: 2019-3-26 00:51

本帖最後由 角色 於 2019-3-26 01:49 編輯

回復 53# slemon

谢谢CHing,我测试过,是的,没有blocked,这样我又可以继续。

Caddy info
https://medium.com/@jestem/caddy ... %94%A8-1e6d25154804
作者: 角色    時間: 2019-3-26 03:38

本帖最後由 角色 於 2019-3-26 09:30 編輯

终于到凌晨三点半,把需要certificates gen了出来!

感谢kingwilliam和selmon两位CHing信息,不然都不知道错在哪里!!!

[attach]4323[/attach]

More information from Let's encrypt

Installing your SSL Certificate
The easiest way to install the SSL certificate is to contact your host, developer or admin. Most of the time your host will install it for free. You can also view ssl certificate installation tutorials depending on your server setup.

If you use IIS and need a PFX file then follow the instructions in the following link to convert the certificate and private key file into a .PFX file - http://stackoverflow.com/a/17284371 (Install openssl and run openssl pkcs12 -export -out "certificate_combined.pfx" -inkey "private.key" -in "certificate.crt" -certfile ca_bundle.crt in a command prompt with path set to location of downloaded certificate files or use https://www.digicert.com/util/)

If you have any issues with certain browsers like Android not recognizing the certificate then test your server SSL configuration on SSL Labs and fix any errors shown.

If you get an error saying the certificate and key do not match then contact your host asking for the key type they accept. If they require the old RSA key type then download OpenSSL and execute the following command on the private key file: openssl rsa -in private.key -out private_rsa.key

If you need the private key in PEM format then install OpenSSL and run the following on the private key file: "openssl rsa -in private.key -text > private.pem"

If you need the multiple certificates in PEM format or everything in PEM format then first convert your private key to PEM format above then follow these instructions.
作者: slemon    時間: 2019-3-26 07:57

回復 55# 角色
Congratulations !!!
作者: 角色    時間: 2019-3-26 22:54

终于改好了V2Ray指ws + tls!!!(用美国vps),下一步就是用V2Ray ws + tls + web。
作者: kingwilliam    時間: 2019-3-26 23:06

回復 57# 角色

C hing 加油
作者: 角色    時間: 2019-3-26 23:16

本帖最後由 角色 於 2019-3-27 15:16 編輯

回復 58# kingwilliam

我也用caddy,问题是如果运行caddy,v2ray就有error,要stop了caddy。

还有我按照白话文[1], Caddyfile
  1. mydomain.me (changed to my hostname)
  2. {
  3.   log ./caddy.log
  4.   proxy /ray localhost:10000 {
  5.     websocket
  6.     header_upstream -Origin
  7.   }
  8. }
複製代碼
,

都不知道怎样处理?CHing是否有suggestion?

In order to start up the web server, I need more information about setting Caddyfile [2,3].

Ref. [4] is also a good example of using vmess + tls + websocket。用户的client node用443过海,然后转12345。所以不会有冲突!!!劲!!!!

References:
[1] https://toutyrater.github.io/advanced/wss_and_web.html
[2] https://ellinia.me/Use_caddy_to_reverse_proxy_project_v/
[3] https://ellinia.me/Use_caddy_to_reverse_proxy_project_v_2/
[4] https://3mile.top/archives/2018/07/21/
作者: 角色    時間: 2019-3-27 15:15

现在单独v2ray: ws + tls是没有问题,单独用caddy建立网站也没有问题,但是两者合起来就出问题,依据[1], 服务端的caddy 实收到client v2ray node的443 packets,caddy+tls,然后用ws跟remote vps连接。但是都不成功。

Reference(s):
[1] https://steemit.com/v2ray/@wuming/v2ray-websocket-tls-caddy-443
作者: kingwilliam    時間: 2019-3-27 20:53

本帖最後由 kingwilliam 於 2019-3-27 21:21 編輯

回復 60# 角色

如 ws+tls+web, 記得 證書 是放在caddy,  之後 v2ray 不要用tls, 因web 已解開tls.
作者: 角色    時間: 2019-3-27 21:24

回復 61# kingwilliam

请教CHing,我有个疑问就是手机的settings:

1. BiFrostV settings 可以对应remote v2ray node (ws, tls)

2. 那么remote end 假如set好了 ws+tls+web, 手机是否跟上面1. 一样,不需要改变?
作者: kingwilliam    時間: 2019-3-27 21:59

本帖最後由 kingwilliam 於 2019-3-27 23:49 編輯

回復 62# 角色

手機不用改變,但server side config.json 要配合caddy作出變更. 電子證書由 v2ray  搬上 caddy.

如server side正常ws+tls
  1. "streamSettings": {
  2.         "network": "ws",
  3.         "wsSettings": {
  4.                 "path": "/vpath2/"
  5.         },
  6.         "security": "tls",
  7.         "tlsSettings": {
  8.                 "certificates": [
  9.                         {
  10.                                 "certificateFile": "/etc/v2ray/cert/cert.crt",
  11.                                 "keyFile": "/etc/v2ray/cert/cert.key"
  12.                         }
  13.                 ]
  14.         }
  15. }
複製代碼
如ws+tls+caddy時
Caddyfile
  1. mydomain.com
  2. {
  3.         proxy /vpath2/ localhost:44301 {
  4.                 websocket
  5.                 header_upstream -Origin
  6.         }
  7.         tls /etc/ssl/caddy/cert.crt /etc/ssl/caddy/cert.key
  8.         root /var/www/mysite
  9. }
複製代碼
如ws+tls+caddy時
config.json
  1. "streamSettings": {
  2.         "network": "ws",
  3.         "wsSettings": {
  4.                 "path": "/vpath2/"
  5.         }
  6. }
複製代碼

作者: 角色    時間: 2019-3-28 03:03

本帖最後由 角色 於 2019-3-28 08:24 編輯

现在是凌晨三点,终于实现V2Ray:ws + tls + web!!!非常感谢两位师兄(kingwilliam和slemon)的鼓励。

现在手机 和 Raspberry(local v2ray)都可以set ws + tls就可以。

download YouTube 都有1440效果,真的不错!!!!
作者: 角色    時間: 2019-3-28 09:54

如果HTTPS里的text,改用HTTP/2,那么就算解开了TLS这一层,里面的信息全都是binary,再去解开的机会率几乎是等于零。还有用HTTP/2会比HTTPS快!
作者: slemon    時間: 2019-3-28 10:05

回復 64# 角色
師兄, 恭喜恭喜!! 記得分享牆內速度。我有點混淆,你的V2ray Server 係VPS還是Raspberry Pi ?  
KingWilliam兄, 唔知梅林能設定Caddy 嗎?
作者: 角色    時間: 2019-3-28 10:11

本帖最後由 角色 於 2019-3-28 10:16 編輯

我VPS在美国,我在那里安装V2Ray的节点(可以说成server)。

在大陆1)用手机安装BiFrostV,vmess + ws + tls,2)用Raspberry Pi安装V2Ray,这个Raspberry Pi放在大陆做大陆的代理,我的大陆电脑用socks5接入这个local V2ray node(Raspberry),然后接去美国的VPS。用这个方式,我的电脑不用安装什么软件,用socks5或者http proxy就可以连上去。

速度一点慢都没有,跟用普通的vmess一样。
作者: 角色    時間: 2019-3-28 10:22

本帖最後由 角色 於 2019-3-28 10:31 編輯

刚才用过我用移动50M,大陆->美国->香港OFCA broadband test结果:

[attach]4343[/attach]

下载都有41Mps已经足够用!!上载就差一点,这个不影响我看网页和YouTube的速度。

上YouTube,自己定能上到2k(1440p),手动fixed at 4k TV都播放流畅,不卡。
作者: 角色    時間: 2019-3-28 12:47

本帖最後由 角色 於 2019-3-28 12:48 編輯

回復 66# slemon

你说起墙内速度,跟没有用V2Ray一样——超快!因为我的V2Ray,set好有分流作用,如果是墙内的websites直接走local gateway!

难度CHing,你在墙内速度不畅顺,所以这样问?现在不管是墙外、墙内上网都超快!!!!爽!!!
作者: 角色    時間: 2019-3-28 15:02

回復 66# slemon

如果梅林上不可以安装caddy,你可以考虑用Raspberry Pi(但是我没有试过,估计可以),或者用工控机行ESXi,再在ESXi上安装你需要的软件。

你的router,只要用来gen certs,然后用Raspberry Pi安装caddy,443的traffic packets先到Raspberry Pi,然后解开tls,再转发到你梅林的v2ray node上就可以。
作者: kingwilliam    時間: 2019-3-28 16:07

本帖最後由 kingwilliam 於 2019-3-28 16:09 編輯

回復 66# slemon

梅林能設定Caddy 嗎?
這個我沒試過,因我之前是用在client side. 但個人意見,256MB跑梅林+v2ray已有點吃力(所以建議加8G U盤做swap) ,如再加caddy/nginx, 真的要測試才知。

所以如 角色 c hing 所言一樣,用 Raspberry Pi 有1G ram型號, 會容易控制好多。
作者: slemon    時間: 2019-3-29 01:46

回復 71# kingwilliam
我是用AC86 router.  RAM有512MB。一般只用大約300MB。當然,我也加咗SWAP drive但都未試過爆RAM用SWAP drive XD
作者: slemon    時間: 2019-3-29 01:57

回復 69# 角色
我下載只有16M,反而不及VPS。Latency 好D 61ms.  試過手動YouTube都睇到2160p XD.
作者: 角色    時間: 2019-3-29 02:13

回復 73# slemon

你的意思是用AC86,刷梅林,里面有V2Ray,Let's Encrypt和Caddy?
作者: kingwilliam    時間: 2019-3-29 08:34

回復 72# slemon

C hing 我沒有在梅林安裝caddy 經驗,但找了一個 手動安裝caddy 介紹 看看可否合用。


    Caddy - 方便够用的 HTTPS server 新手教程
作者: slemon    時間: 2019-3-29 09:45

回復 74# 角色
角色師兄,我之前試過係梅林router裝Caddy, 失敗咗,所以睇下King Sir有沒有裝上,分享下.暫時都好滿足現在WS + TLS 方案.
另外, 我在手機用v2rayNG. 不錯的. 但用上BifrostV時,不能上網, 要係Apps內開啟"Allow Insecure"才能用,正常嗎? 你們有沒有設定TLS Server Name 和Headers? Thanks.
作者: kingwilliam    時間: 2019-3-29 10:22

本帖最後由 kingwilliam 於 2019-3-29 10:47 編輯

回復 76# slemon

"sir" 不敢當 一同研究

問:要係Apps內開啟"Allow Insecure"才能用。
答:(我都有這現象,還在測試中,可能是bifrostv 內核還沒跟上有關)
因之前的version "allow insecure ", 就是check 證書合法與否(如自簽證書 或 證書申請名稱同現在FQDN不付)。但最近已改了是用TLS 1.3 或  1.2加密(官網說是加密套件,不是真正的TLS1. 3協議)

問:你們有沒有設定TLS Server Name 和Headers?
答:TLS server name, 就是給證書內的名稱 和 現用的FQDN不付時用的。 但有用家在官網forum report好像不太work 。詳情可到官網forum 看看
Headers 是在沒有TLS時 伪装 成其他數據包 騙過 牆 時用的。如已用TLS 連 header 也會加密,所以用TLS時不需用header.。

所以我兩個設定都沒用。(但h2+tls+web時,就有需要加入)
作者: slemon    時間: 2019-3-29 10:31

本帖最後由 slemon 於 2019-3-29 10:38 編輯

回復 77# kingwilliam
我的Server是用4.18.0. 謝謝King Sir 回覆.
作者: 角色    時間: 2019-3-29 10:35

回復 76# slemon

我以前都是V2RayNG,如果用Vmess是没有问题,但是用Shadowsocks就不太好,而BiFrostV就非常好,在大陆根据不需要什么rules,大陆的apps和IP走direct,其他走proxy,所以手机的微信、淘宝、支付宝、、、、大陆的app走local direct,非常方便。很多V2Ray还没有的settings,在BiFrostV里全有。

因为我的中文机,所以下面都是中文:
1、 配置名称:随便填你喜爱的
2、主机:server hostname (cert 的 申请hostname,如www.abc.com
3、端口:port number
4、用户ID:UUID
5、AlteID:64
6、加密:auto
7、用户等级:0(default)
8、网络:WebSocket
9、加密方式:tls
10、服务器证书域名:www.abc.com
11、WebSocket 路径:/v2ray/  (这个要自己定,要跟server node一致)
12、HTTP头:(app自己自动填,连好了,你会看见你的域名:Host:www.abc.com

其他参数是defaults,我没有改过。至于你说的“允许不安全连接”,我没有选,就用default。
作者: slemon    時間: 2019-3-29 10:43

回復 79# 角色
角色師兄, 謝謝回覆.  V2RayNG也有設定那個應用程式走Proxy.  在左邊menu設定第一個選項.
作者: 角色    時間: 2019-3-29 10:48

回復 80# slemon

问题是你不用选,这个BiFrostV的设计主要用于大陆,如果在大陆使用,根本什么都不用set,当然你也可以可以去set那些app走proxy,那些走direct。

不管用哪个,用你一个熟悉就可以。
作者: slemon    時間: 2019-3-29 10:52

回復 79# 角色
角色師兄,剛剛又再測試BifrostV, 還是必需要開啟"Allow Insecure"才能上網.  會不會跟Server version有關係? 你用那個版本?  謝謝
作者: 角色    時間: 2019-3-29 11:20

本帖最後由 角色 於 2019-3-29 11:40 編輯

回復 82# slemon

我用的版本是0.6.8。我之前都遇过这个问题,我也记不清,主要是Caddyfile和config.json之间的settings。

我的排查方式就是用BiFrostV用ws+tls连接remote v2ray node是不需要启动“允许不安全连接”,然后我加上caddy后,在最初测试都要启动“允许不安全连接”,才能联通。

难度在ws+tls的手机settings(local v2ray node)与remote的v2ray node settings不一致?所以导致要启动“允许不安全连接”?

V2Ray version,我两边都是用v4.18。
作者: 角色    時間: 2019-3-29 12:32

回復 76# slemon

CHing你gen出来的cert,是否有用下面网址测试过:

https://www.ssllabs.com/ssltest/index.html

我的是显示"GOOD" A级!
作者: slemon    時間: 2019-3-29 12:39

回復 84# 角色
我係Overall Rating B
作者: 角色    時間: 2019-3-29 12:53

不知道这与“允许不安全连接”是否有关呢?
作者: kingwilliam    時間: 2019-3-29 19:11

回復 85# slemon
作者: kingwilliam    時間: 2019-3-29 19:20

回復 85# slemon

c hing 有否留意 Grade B 是否因為server's certificate chain is incomplete.
    [attach]4344[/attach]

如果是, 還記得let'sencrypt 有3個file
- private.key
- ca_bundle.crt
- certificate.crt


你只需用text editor 開啟certificate.crt, 張ca_bundel.crt copy and paste 到certificate.crt最尾。
-----BEGIN CERTIFICATE-----
{ certificate.crt }
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
{ ca_bundle.crt }
-----END CERTIFICATE-----

之後restart service. 就成功. 如再做ssllabs 應該就可以Grade A
[attach]4345[/attach]
作者: 角色    時間: 2019-3-29 20:27

估计我用caddy去gen certificate,它自动把你说的动作pack在一起,所以A grade,不知道这个改变后是否不需要允许“允许不安全连接”呢?
作者: 角色    時間: 2019-3-29 20:27

回復 77# kingwilliam

CHing你是否“允许不安全连接”也解决了?
作者: kingwilliam    時間: 2019-3-29 20:44

回復 90# 角色


BifrostV - 要 enable allowinsecure
但中山家個v2ray - 就 disable allowinsecure
作者: slemon    時間: 2019-3-29 20:49

回復 88# kingwilliam
多謝King Sir!原來Let's Encrypt 已有4個files...我查看原來fullchain.pem就是包含cert.pem+chain.pem. 我改config.json用fullchain.pem做cert. file.  再測試,馬上變回A grade.
domain.key
cert.pem
chain.pem
fullchain.pem

另外,我不明白protocol support 不是100分。TLS 1.3項目是"No"
作者: 角色    時間: 2019-3-29 21:23

本帖最後由 角色 於 2019-3-29 21:30 編輯

我的TLS 1.2,TLS 1.3都是yes。是否大家用不同方式去gen,而我跟kingwilliam CHing一样,跟的cert与我的名称一样。但是如果用caddy里面gen的话,它自动打包到所需要的格式。

因为我也不太熟悉pem的格式,我只用xxx.crt, xxx.key,不知道是否你用这样方式可以把问题解决?

用Let's Encrypt generate出来的文件是:
  1. ca_bundle.crt       
  2. certificate.crt       
  3. private.key
複製代碼
.
作者: slemon    時間: 2019-3-29 21:37

回復 93# 角色
師兄,更改config.json 用fullchain.pem之後,不用開啟"Allow insecure"也能上網了。改回之前cert.pem就上不到,而且CPU loading 狂升到100%,一定要開Allow insecure才能上網。 謝謝角色和King Sir解決這個問題。
作者: kingwilliam    時間: 2019-3-29 22:06

回復 92# slemon


    TLS 1.3項目是"No"
可能因沒 Caddy 有關.
作者: slemon    時間: 2019-3-31 16:38

回復 95# kingwilliam
原來V2ray 還未支持Tls 1.3.  還是要等待 XD
作者: 角色    時間: 2019-3-31 19:36

本帖最後由 角色 於 2019-3-31 20:10 編輯

我们知道都是用v2ray + ws + tls + web, 大家是否有试过v2ray + h2 + tls + web?

下面链接是参考点:
https://canmipai.com/index.php/2018/06/28/v2ray_h2_web_tutorial/
https://51acg.eu.org/v2ray-caddy-http2.html
https://www.feiqy.com/v2ray-best-config/
https://ailitonia.com/archives/v2ray-http-2%E9%85%8D%E7%BD%AE/
https://www.ivyseeds.cf/v2h2/
https://luke6887.me/?p=292
https://biner.ml/2018/10/25/V2Ray+h2+tls+web/
https://www.noip117.com/index.php/archives/7/
作者: slemon    時間: 2019-3-31 22:11

回復 97# 角色
網頁還是HTTP/1.1為主。H2會不會被關注, 看不到什麼好處,所以沒打算試 XD
作者: 角色    時間: 2019-4-1 12:12

本帖最後由 角色 於 2019-4-1 12:32 編輯

回復 98# slemon

其实到现在可以V2Ray + ws + tls + web(caddy)我已经很满意!!!只不过想如果通过HTTP/2能交换信息快一点的话就更加好!
作者: 角色    時間: 2019-4-12 11:19

如果新的members在使用懒人包进行科学上网的时候遇到问题,欢迎跟帖讨论。




歡迎光臨 電訊茶室 (http://www.telecom-cafe.com/forum/) Powered by Discuz! 7.2