-
Notifications
You must be signed in to change notification settings - Fork 2
/
free-public-v2ray-xray-servers.html
219 lines (205 loc) · 12.2 KB
/
free-public-v2ray-xray-servers.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>How to Create Free Public-Interest V2Ray and Xray Servers</title>
<link rel="stylesheet" href="css/style.css">
<meta property="og:title" content="How to Create Free Public-Interest V2Ray and Xray Servers">
<meta property="og:description" content="The architecture in this post makes it safer for anyone to offer free public-interest V2Ray and Xray servers">
<meta property="og:type" content="website">
<meta property="og:image" content="https://computerscot.github.io/img/computerscot.png">
<meta property="og:url" content="https://computerscot.github.io/free-public-v2ray-xray-servers.html">
</head>
<body>
<div id="bar">
<div class="wrapper">
<p><a href="https://computerscot.github.io">computerscot.github.io</a></p>
</div>
</div>
<div class="wrapper">
<h1>How to Create Free Public-Interest V2Ray and Xray Servers</h1>
<p><em>September 24, 2023</em></p>
<h2>Overview</h2>
<p>Some people need a quick and free way to access a V2Ray or Xray server.</p>
<p>At the same time, other people are willing to provide free V2Ray or Xray servers, if they are in the public interest.</p>
<p>One thing that puts people off from providing free V2Ray or Xray servers is that you are effectively acting as an exit node. Whatever anyone does on your server can be blamed on you.</p>
<p>The architecture in this post addresses this problem. It makes it safer for anyone to offer free public-interest V2Ray or Xray servers.</p>
<pre>
+----------+ +--------+--------+
| *ray | | *ray | Tor |
| Client +------->+ Server + Client +------> TOR
| | | | |
+----------+ +--------+--------+
</pre>
<p>The free server accepts V2Ray or Xray traffic, but forces it into the Tor network. The risk is shunted to the knowledgeable and well-resourced organizations who host Tor exit nodes.</p>
<p>Also, since Tor will be slower than a commercial VPN, your server will not be exploited by cheap people who want a VPN but want someone else to pay for it. Note also that Tor handles only TCP traffic.</p>
<p>The remainder of this post shows you how to set up the server and gives an example of installing a client.</p>
<h2>Set Up Tor Client on Server</h2>
<p>Install the prerequisite package to access the Tor repositories:</p>
<blockquote><code>apt install -y apt-transport-https</code></blockquote>
<p>Create <code>/etc/apt/sources.list.d/tor.list</code> like the example below (the distribution here is Ubuntu 22.04, which is why the distribution is <code>jammy</code>):</p>
<blockquote><code>deb [signed-by=/usr/share/keyrings/tor-archive-keyring.gpg] https://deb.torproject.org/torproject.org jammy main</code></blockquote>
<blockquote><code>deb-src [signed-by=/usr/share/keyrings/tor-archive-keyring.gpg] https://deb.torproject.org/torproject.org jammy main</code></blockquote>
<p>Get the Tor signing key:</p>
<blockquote><code>wget -qO- https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc | gpg --dearmor | tee /usr/share/keyrings/tor-archive-keyring.gpg >/dev/null</code></blockquote>
<p>Install Tor:</p>
<blockquote><code>apt update && apt install -y tor deb.torproject.org-keyring</code></blockquote>
<p>By default, Tor listens for SOCKS traffic on port <code>9050</code>:</p>
<blockquote><code>systemctl status tor@default</code></blockquote>
<blockquote><code>ss -tulpn | grep 9050</code></blockquote>
<h2>Set Up V2Ray or Xray Server</h2>
<p>Install the latest version of Xray to host your V2Ray or Xray server:</p>
<blockquote><code>bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ install --beta -u root</code></blockquote>
<p>(If you are using V2Ray instead of Xray, use <a href="https://github.com/v2fly/fhs-install-v2ray">https://github.com/v2fly/fhs-install-v2ray</a>.)</p>
<p>Generate UUID:</p>
<blockquote><code>xray uuid</code></blockquote>
<p>Example:</p>
<blockquote><code>22e22181-0fe1-4fb1-8fcf-f12c0c59e531</code></blockquote>
<p>Generate public-private key pair:</p>
<blockquote><code>xray x25519</code></blockquote>
<p>Example:</p>
<blockquote><code>Private key: QIqQz_iI2QNV_2CFnxJJurFwre6mxL5XEjA70LZqRGk<br>
Public key: _J7qLmphZmLBayaKx0djjYt8KT0c_EfEmV2M4KAxniA</code></blockquote>
<p>Generate short id:</p>
<blockquote><code>openssl rand -hex 8</code></blockquote>
<p>Example:</p>
<blockquote><code>73459cc25fe18a97</code></blockquote>
<p>Edit the Xray configuration file <code>/usr/local/etc/xray/config.json</code>. Make it look like this.</p>
<pre>
{
"routing": {
"domainStrategy": "IPIfNonMatch",
"rules": [
{
"type": "field",
"ip": [
"geoip:private"
],
"outboundTag": "block"
}
]
},
"inbounds": [
{
"listen": "0.0.0.0",
"port": 443,
"protocol": "vless",
"settings": {
"clients": [
{
"id": "22e22181-0fe1-4fb1-8fcf-f12c0c59e531",
"flow": ""
}
],
"decryption": "none"
},
"streamSettings": {
"network": "h2",
"security": "reality",
"realitySettings": {
"show": false,
"dest": "www.cisco.com:443",
"xver": 0,
"serverNames": [
"www.cisco.com"
],
"privateKey": "QIqQz_iI2QNV_2CFnxJJurFwre6mxL5XEjA70LZqRGk",
"shortIds": [
"73459cc25fe18a97"
]
}
}
}
],
"outbounds": [
{
"protocol": "socks",
"tag": "tor",
"settings": {
"servers": [
{
"address": "127.0.0.1",
"port": 9050
}
]
}
},
{
"protocol": "blackhole",
"tag": "block"
}
]
}
</pre>
<p>Restart Xray with your configuration:</p>
<blockquote><code>
systemctl restart xray && systemctl status xray</code></blockquote>
<h2>Communicate V2Ray or Xray Parameters to Clients</h2>
<p>Supply the server parameters to the public. You can also supply them as a URI-style <code>vmess://</code> or <code>vless://</code> link, or as a QR code. Most clients can import server parameters from a URI or on-screen QR code.</p>
<h2>Clients</h2>
<p>Clients are available for many platforms. Here are some examples:</p>
<ul>
<li>For Windows, <a href="https://github.com/2dust/v2rayn">v2rayN</a> or <a href="https://github.com/MatsuriDayo/nekoray">Nekoray</a></li>
<li>For macOS, <a href="https://github.com/yanue/V2rayU">V2rayU</a></li>
<li>For Linux, <a href="https://github.com/v2rayA/v2rayA">v2rayA</a> or <a href="https://github.com/MatsuriDayo/nekoray">Nekoray</a></li>
<li>For Android, v2rayNG from <a href="https://play.google.com/store/apps/details?id=com.v2ray.ang">Google Play</a> or from <a href="https://github.com/2dust/v2rayNG">GitHub</a></li>
<li>For iOS and iPadOS, <a href="https://apps.apple.com/us/app/shadowrocket/id932747118">Shadowrocket</a></li>
</ul>
<p>We will give detailed installation instructions for v2rayN for Windows.</p>
<h3>Install v2rayN for Windows Client</h3>
<p>Open a browser and visit <a href="https://github.com/2dust/v2rayn">https://github.com/2dust/v2rayn</a>, a GUI client supporting Xray, V2Ray, Shadowsocks, and other protocols.</p>
<img src="/img/183.png" alt="GitHub repository for v2rayN by 2dust">
<p>Scroll down and click <strong>Releases</strong> in the sidebar.<p>
<img src="/img/184.png" alt="Releases link on GitHub page for v2rayN">
<p>The topmost release will be the most recent.<p>
<img src="/img/185.png" alt="v2rayN most recent release">
<p>Scroll down to the <strong>Assets</strong> section, and expand the list of <strong>Assets</strong>.<p>
<img src="/img/187.png" alt="v2rayN Assets for the release">
<p>Download <code>v2rayN-With-Core.zip</code>.<p>
<img src="/img/188.png" alt="v2rayN-With-Core.zip">
<p>The <code>.zip</code> file is saved to your <code>Downloads</code> folder.<p>
<img src="/img/189.png" alt="v2rayN zip file downloaded to PC">
<p>Right-click on the <code>.zip</code> file, and select <strong>Extract All...</strong>.<p>
<img src="/img/190.png" alt="Context menu to extract v2rayN zip file">
<p>The inner folder is extracted.<p>
<img src="/img/191.png" alt="v2rayN with Core inner folder">
<p>In the extracted folder, click <code>v2rayN.exe</code> to launch the application.<p>
<img src="/img/193.png" alt="v2rayN application exe file in extracted folder">
<p>Click the up-arrow at the bottom right of your Windows desktop to bring up the icons in the system tray.<p>
<img src="/img/195.png" alt="Accessing system tray icons in Windows">
<p>Click the v2rayN icon to bring up the GUI panel.<p>
<img src="/img/196.png" alt="v2rayN icon in Windows system tray">
<p>If you want to change the interface language, click the three dots button in the menu.<p>
<img src="/img/200.png" alt="v2rayN GUI panel initial appears and three dots button">
<p>You can choose between Simplified Chinese, Traditional Chinese, English, Farsi, and Russian.<p>
<img src="/img/202.png" alt="Changing the v2rayN language">
<p>Now right-click on the v2rayN icon in the system tray, and select the bottom-most option to exit v2rayN.</p>
<img src="/img/203.png" alt="Exit v2rayN using context menu in Windows system tray">
<p>Go back to the extracted folder, and click <code>v2rayN.exe</code> again to re-launch the application.<p>
<img src="/img/204.png" alt="v2rayN application exe file in extracted folder">
<p>Again click the v2rayN icon to bring up the GUI panel.<p>
<img src="/img/205.png" alt="v2rayN icon in Windows system tray">
<p>Now the interface is in English.<p>
<img src="/img/206.png" alt="v2rayN GUI panel with language set to English">
<p>Right-click on the v2rayN icon in the system tray, and you will see that the context menu is also in English.<p>
<img src="/img/207.png" alt="v2rayN context menu with language set to English">
<p>From the <strong>Server</strong> menu, you can add servers manually, from a URL in the Windows clipboard, or from a QR code on the screen.<p>
<img src="/img/215.png" alt="v2rayN Servers menu">
<p>Make sure your QR code is on the screen, then you can import a server definition from the on-screen QR code.</p>
<p>Right-click on the v2rayN icon in the system tray, and you can optionally <strong>Set system proxy</strong>, which means you won't have to set individual browsers to use the proxy server.<p>
<img src="/img/216.png" alt="v2rayN Set system proxy">
<p>Open a browser and visit some websites. If you wish, you can check your apparent IP address by visiting <a href="https://check.torproject.org">https://check.torproject.org</a>.</p>
<img src="/img/228.png" alt="https://check.torproject.org">
<p>When you have finished browsing, right-click on the v2rayN icon in the system tray, and select <strong>Exit</strong>.<p>
<img src="/img/229.png" alt="v2rayN Exit">
<h2>Support Forums</h2>
<ul>
<li>For Xray (which we are using here for the server), <a href="https://t.me/projectXray">https://t.me/projectXray</a></li>
<li>For the Tor Project, <a href="https://forum.torproject.org">https://forum.torproject.org</a></li>
<li>For the V2Ray and Xray clients, refer to GitHub issues and discussions pages for individual clients</li>
</ul>
</div>
<!-- Cloudflare Web Analytics --><script defer src='https://static.cloudflareinsights.com/beacon.min.js' data-cf-beacon='{"token": "94e45ea74d58413395c468ebe6bab324"}'></script><!-- End Cloudflare Web Analytics -->
</body>
</html>