{"id":324,"date":"2023-01-30T18:59:47","date_gmt":"2023-01-30T13:59:47","guid":{"rendered":"https:\/\/bernd32.xyz\/blog\/?p=324"},"modified":"2023-04-01T23:51:40","modified_gmt":"2023-04-01T17:51:40","slug":"guide-on-installing-shadowsocksv2ray-server-with-traffic-obfuscation-cloudflare-over-tls-in-debian-10","status":"publish","type":"post","link":"https:\/\/bernd32.xyz\/blog\/?p=324","title":{"rendered":"Guide on installing shadowsocks+v2ray server with traffic obfuscation (Cloudflare) over TLS in Debian 10"},"content":{"rendered":"<p>English translation of my post, original version in Russian is <a href=\"https:\/\/bernd32.xyz\/blog\/?p=264\">here<\/a>.<\/p>\n<p>Just a few words before we get started. You can skip this part if you want.<\/p>\n<p><strong>Introduction.<\/strong><\/p>\n<p><span class=\"HwtZe\" jsaction=\"mouseup:Sxi9L,BR6jm; mousedown:qjlr0e\" jsname=\"jqKxS\" lang=\"en\">With internet regulation and censorship on the rise, states increasingly engaging in online surveillance, and state cyber-policing capabilities rapidly evolving globally, concerns about regulatory &#8220;chilling effects&#8221; online &#8211; the idea that laws, regulations, or state surveillance can deter people from exercising their freedoms or engaging in legal activities on the internet have taken on greater urgency and public importance [1]. <span jsaction=\"agoMJf:PFBcW;MZfLnc:P7O7bd;nt4Alf:pvnm0e,pfE8Hb,PFBcW;B01qod:dJXsye;H1e5u:iXtTIf;lYIUJf:hij5Wb;bmeZHc:iURhpf;Oxj3Xe:qAKMYb,yaf12d\" jsname=\"txFAF\" class=\"jCAhz ChMk0b\" jscontroller=\"Gn4SMb\"><span class=\"ryNqvb\" jsaction=\"click:E6Tfl,GFf3ac,tMZCfe; contextmenu:Nqw7Te,QP7LD; mouseout:Nqw7Te; mouseover:E6Tfl,c2aHje\" jsname=\"W297wb\">Today, the most popular way to bypass Internet censorship are VPN services.<\/span><\/span> <span jsaction=\"agoMJf:PFBcW;MZfLnc:P7O7bd;nt4Alf:pvnm0e,pfE8Hb,PFBcW;B01qod:dJXsye;H1e5u:iXtTIf;lYIUJf:hij5Wb;bmeZHc:iURhpf;Oxj3Xe:qAKMYb,yaf12d\" jsname=\"txFAF\" class=\"jCAhz ChMk0b\" jscontroller=\"Gn4SMb\"><span class=\"ryNqvb\" jsaction=\"click:E6Tfl,GFf3ac,tMZCfe; contextmenu:Nqw7Te,QP7LD; mouseout:Nqw7Te; mouseover:E6Tfl,c2aHje\" jsname=\"W297wb\">However, they have quite significant drawbacks, which are completely or partially solved by setting up your own shadowsocks server.<\/span><\/span> <span jsaction=\"agoMJf:PFBcW;MZfLnc:P7O7bd;nt4Alf:pvnm0e,pfE8Hb,PFBcW;B01qod:dJXsye;H1e5u:iXtTIf;lYIUJf:hij5Wb;bmeZHc:iURhpf;Oxj3Xe:qAKMYb,yaf12d\" jsname=\"txFAF\" class=\"jCAhz ChMk0b\" jscontroller=\"Gn4SMb\"><span class=\"ryNqvb\" jsaction=\"click:E6Tfl,GFf3ac,tMZCfe; contextmenu:Nqw7Te,QP7LD; mouseout:Nqw7Te; mouseover:E6Tfl,c2aHje\" jsname=\"W297wb\">In this guide I will teach how to do it.\u00a0<\/span><\/span><\/span><\/p>\n<p>You can ask a reasonable question: why bother so much when there is a VPN services? So, to begin with, I will list the pros and cons of a VPN over a shadowsocks server:<\/p>\n<p><strong>Pros of VPN services:<\/strong><\/p>\n<p>The user does not need any technical knowledge and time-consuming configuration, just install a VPN client and use it. Setting up an SS server, especially with traffic obfuscation, requires some skills and knowledge that most users do not have.<\/p>\n<p><strong>Cons<\/strong>:<\/p>\n<p>&#8211; VPN services can be slow, including the paid ones. I won&#8217;t even mention the free ones, as they are often extremely slow and may not provide adequate privacy protection. ISPs may intentionally throttle the speed of suspicious encrypted traffic originating from VPNs. This issue can be addressed by employing traffic obfuscation through basic TLS encryption, which appears legitimate to your ISP.<\/p>\n<p>&#8211; VPNs are not entirely secure. If someone is determined, they can find you relatively quickly: either the VPN service might hand over your information to authorities, or your ISP could track you using a so-called &#8220;correlation attack.&#8221; This is when an ISP compares the IP address a user utilizes to access certain online content or visit a restricted website with the IP addresses connected at that time, enabling the ISP to potentially identify an internet dissident&#8217;s real IP address. In this context, SS + v2ray + tls is a safer option for users residing in totalitarian countries like Russia or China. By the way, the Shadowsocks protocol and v2ray were developed by users in China.<\/p>\n<p>Besides speed and security, circumventing internet censorship and surveillance with SS+v2ray can be absolutely free! You just need to find a shareware virtual server (for example, Oracle Cloud, which has an unlimited trial period) and a free domain (such as a .tk domain provided by Freenom). However, using free services can be somewhat risky since you don&#8217;t have full ownership, and both the VPS and domain could be taken away from you at any moment.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Steps to set up your SS server:<\/strong><\/p>\n<p>&#8211; Getting a virtual server (VPS) running on Debian (you can use any distro you want, but in this tutorial I&#8217;m using Debian 10)<\/p>\n<p>&#8211; Getting a domain (you can go with any domain, Freenom&#8217;s .tk for example)<\/p>\n<p>&#8211; Signing up on Cloudflare and linking the domain there<\/p>\n<p>&#8211; Deploying the shadowsocks and a web server on the VPS<\/p>\n<p>&#8211; Getting a free SSL certificate and setting up traffic obfuscation<\/p>\n<p>&#8211; Setting up a client for windows\/android\/ios\/linux.<\/p>\n<p>Let&#8217;s get started.<\/p>\n<p><strong>Getting a virtual server (VPS) <\/strong><\/p>\n<p>Any inexpensive virtual server provider will do. Oracle Cloud and Microsoft Azure are fine and they&#8217;re free too! (though, there is a limit on the amount of traffic). There is nothing complicated in getting a virtual server, just make sure that you are provided with a <em>dedicated static IP address<\/em> and have open ports 80, 443 and 22 (usually they are opened by default). You can also choose a suitable VPS from this list: <a href=\"https:\/\/bitcoin-vps.com\/\">https:\/\/bitcoin-vps.com\/<\/a><\/p>\n<p><strong>Getting a domain<\/strong><\/p>\n<p>Get any domain you want, .tk domains are free (you can get one here: <a href=\"https:\/\/www.freenom.com\">https:\/\/www.freenom.com<\/a>)<\/p>\n<p><strong>Signing up on Cloudflare and linking the domain (adding DNS records)<br \/>\n<\/strong><\/p>\n<p><span class=\"HwtZe\" jsaction=\"mouseup:Sxi9L,BR6jm; mousedown:qjlr0e\" jsname=\"jqKxS\" lang=\"en\"><span jsaction=\"agoMJf:PFBcW;MZfLnc:P7O7bd;nt4Alf:pvnm0e,pfE8Hb,PFBcW;B01qod:dJXsye;H1e5u:iXtTIf;lYIUJf:hij5Wb;bmeZHc:iURhpf;Oxj3Xe:qAKMYb,yaf12d\" jsname=\"txFAF\" class=\"jCAhz ChMk0b\" jscontroller=\"Gn4SMb\"><span class=\"ryNqvb\" jsaction=\"click:E6Tfl,GFf3ac,tMZCfe; contextmenu:Nqw7Te,QP7LD; mouseout:Nqw7Te; mouseover:E6Tfl,c2aHje\" jsname=\"W297wb\">As an example, let&#8217;s take the bernd32.xyz domain. To do this, in the cloudflare, specify the IP address of our SS server, one is just bernd32.xyz, the second is www.bernd32.xyz, click next.<\/span><\/span><\/span><\/p>\n<p>In this guide I&#8217;ll use one of my domains bernd32.xyz, replace with your own. We need to make two DNS records:<\/p>\n<p>1) &#8220;A&#8221; record with the name &#8220;www&#8221; and IP address of your VPS<\/p>\n<p>2) &#8220;A&#8221; record with the name &#8220;bernd32.xyz&#8221; and IP address of your VPS<\/p>\n<p>Next, click &#8220;Continue.&#8221; Afterward, Cloudflare will generate name servers that should be entered into the control panel of your domain registrar. If you obtained your free .tk domain from Freenom, the control panel page might look something like this:<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/bernd32.xyz\/blog\/files\/uploads\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-2022-03-30-134249-1024x608.jpg\" alt=\"\" class=\"aligncenter size-large wp-image-268\" srcset=\"https:\/\/bernd32.xyz\/blog\/wp-content\/uploads\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-2022-03-30-134249-1024x608.jpg 1024w, https:\/\/bernd32.xyz\/blog\/wp-content\/uploads\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-2022-03-30-134249-300x178.jpg 300w, https:\/\/bernd32.xyz\/blog\/wp-content\/uploads\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-2022-03-30-134249-768x456.jpg 768w, https:\/\/bernd32.xyz\/blog\/wp-content\/uploads\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-2022-03-30-134249.jpg 1449w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" width=\"1024\" height=\"608\" \/><\/p>\n<p>Wait for a few hours for the DNS records to update. In the meantime, let&#8217;s navigate to the Cloudflare Firewall settings and change the Security level to &#8220;Essentially Off&#8221;:<\/p>\n<p><!--more--><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/bernd32.xyz\/blog\/files\/uploads\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-2022-03-30-134526-1024x931.jpg\" alt=\"\" class=\"size-large wp-image-269 aligncenter\" srcset=\"https:\/\/bernd32.xyz\/blog\/wp-content\/uploads\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-2022-03-30-134526-1024x931.jpg 1024w, https:\/\/bernd32.xyz\/blog\/wp-content\/uploads\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-2022-03-30-134526-300x273.jpg 300w, https:\/\/bernd32.xyz\/blog\/wp-content\/uploads\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-2022-03-30-134526-768x698.jpg 768w, https:\/\/bernd32.xyz\/blog\/wp-content\/uploads\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-2022-03-30-134526.jpg 1192w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" width=\"1024\" height=\"931\" \/><\/p>\n<p>That&#8217;s it.<\/p>\n<p><strong>Setting up the shadowsocks and a web server for traffic obfuscation<br \/>\n<\/strong><\/p>\n<p>First, we need to open incoming ports on the firewall of your VPS. If you&#8217;re an inexperienced user, create a snapshot of your virtual server before proceeding. If something goes wrong (for example, if you can&#8217;t connect to the VPS via SSH), you can easily restore it to the point when everything was working fine. Keep in mind that on some VPS providers (such as Oracle Cloud and Microsoft Azure), ports need to be opened not only on the server itself but also in the control panel. For instance, in Oracle, this is done through the Security List: https:\/\/docs.oracle.com\/en-us\/iaas\/Content\/Network\/Concepts\/securitylists.htm<\/p>\n<p>However, the required ports are usually open by default.<\/p>\n<p>Remember that all commands in the terminal are executed using root.<\/p>\n<p>Moreover, you shouldn&#8217;t blindly copy the commands below. Always carefully consider what you are entering in the terminal.<\/p>\n<p>&nbsp;<\/p>\n<p>Connect to our server by SSH:<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-plain\" data-lang=\"Plain Text\"><code>ssh root@&lt;ip of your VPS&gt;<\/code><\/pre>\n<\/div>\n<p>for example:<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-plain\" data-lang=\"Plain Text\"><code>ssh root@23.78.206.154<\/code><\/pre>\n<\/div>\n<p>Add ports for http and https. The easiest way to do this is through UFW. Install UFW if don&#8217;t have this package:<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-plain\" data-lang=\"Plain Text\"><code>apt install ufw<\/code><\/pre>\n<\/div>\n<p>Opening ports with ufw:<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-plain\" data-lang=\"Plain Text\"><code>ufw allow 443\/tcp \r\nufw allow 443\/udp \r\nufw allow 80\/tcp \r\nufw allow 80\/udp \r\nufw allow ssh \r\nufw enable<\/code><\/pre>\n<\/div>\n<pre data-lang=\"Plain Text\"><\/pre>\n<p>Installing nginx as your web server:<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-plain\" data-lang=\"Plain Text\"><code>apt update &amp;&amp; sudo apt upgrade apt install nginx<\/code><\/pre>\n<\/div>\n<p>Remove the default config file:<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-plain\" data-lang=\"Plain Text\"><code>rm \/etc\/nginx\/sites-available\/default &amp;&amp; sudo rm \/etc\/nginx\/sites-enabled\/default<\/code><\/pre>\n<\/div>\n<p>If you got error <em>rm: cannot remove \u2018\/etc\/nginx\/sites-available\/default\u2019: No such file or directory<\/em>, then create the needed directories:<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-plain\" data-lang=\"Plain Text\"><code>mkdir \/etc\/nginx\/sites-available \r\nmkdir \/etc\/nginx\/sites-enabled<\/code><\/pre>\n<\/div>\n<p>Make a directory in which your website files will be stored:<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-plain\" data-lang=\"Plain Text\"><code>sudo mkdir \/var\/www\/&lt;your_domain&gt;<\/code><\/pre>\n<\/div>\n<p>Create index.html file there:<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-plain\" data-lang=\"Plain Text\"><code>nano \/var\/www\/&lt;your_domain&gt;\/index.html<\/code><\/pre>\n<\/div>\n<p>Edit index.html and write down anything you want, it doesn&#8217;t really matter. Here&#8217;s my example:<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-html\" data-lang=\"HTML\"><code>&lt;!DOCTYPE html&gt;\r\n&lt;html lang=\"en\"&gt;\r\n&lt;head&gt;\r\n&lt;meta charset=\"UTF-8\"&gt;\r\n&lt;meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"&gt;\r\n&lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"&gt;\r\n&lt;title&gt;Document&lt;\/title&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n&lt;h1&gt; \u041e\u043b\u043e\u043b\u043e! \u0412\u0441\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442&lt;\/h1&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/code><\/pre>\n<\/div>\n<p>Open the nginx&#8217;s config file (\/etc\/nginx\/nginx.conf) and specify our website config directory in http module:<\/p>\n<pre class=\"prism line-numbers language-plain\" data-lang=\"Plain Text\"><code class=\" language-plain\" data-hcb-clip=\"10\">include \/etc\/nginx\/sites-enabled\/*;<\/code><\/pre>\n<p>Make config for your nginx website:<\/p>\n<pre class=\"prism line-numbers language-plain\" data-lang=\"Plain Text\"><code class=\" language-plain\" data-hcb-clip=\"11\">nano \/etc\/nginx\/sites-available\/&lt;your_domain&gt;<\/code><\/pre>\n<p>Paste to the config file (don&#8217;t forget to change &lt;your_domain&gt;):<\/p>\n<pre class=\"prism line-numbers language-plain\" data-lang=\"Plain Text\"><code class=\" language-plain\" data-hcb-clip=\"12\">server {\r\n\u00a0 \u00a0 listen 80;\r\n\u00a0 \u00a0 #listen [::]:80;\r\n\u00a0 \u00a0 server_name &lt;your_domain&gt;;\r\n\u00a0 \u00a0 root \/var\/www\/&lt;your_domain&gt;;\r\n\u00a0 \u00a0 index index.html;\r\n\u00a0\r\n\u00a0 \u00a0 location \/anime {\r\n\u00a0 \u00a0 \u00a0 \u00a0 proxy_redirect off;\r\n\u00a0 \u00a0 \u00a0 \u00a0 proxy_http_version 1.1;\r\n\u00a0 \u00a0 \u00a0 \u00a0 proxy_pass http:\/\/localhost:8008;\r\n\u00a0 \u00a0 \u00a0 \u00a0 proxy_set_header Host $http_host;\r\n\u00a0 \u00a0 \u00a0 \u00a0 proxy_set_header Upgrade $http_upgrade;\r\n\u00a0 \u00a0 \u00a0 \u00a0 proxy_set_header Connection \"upgrade\";\r\n\u00a0 \u00a0 \u00a0 \u00a0 }\r\n}<\/code><\/pre>\n<p>Enable the website:<\/p>\n<pre class=\"prism line-numbers language-plain\" data-lang=\"Plain Text\"><code class=\" language-plain\" data-hcb-clip=\"13\">ln -s \/etc\/nginx\/sites-available\/&lt;\u0434\u043e\u043c\u0435\u043d&gt; \/etc\/nginx\/sites-enabled\/<\/code><\/pre>\n<p>Restart nginx:<\/p>\n<pre class=\"prism line-numbers language-plain\" data-lang=\"Plain Text\"><code class=\" language-plain\" data-hcb-clip=\"14\">sudo systemctl restart nginx<\/code><\/pre>\n<p>Your website should be working right know. Check it in your browser:<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/bernd32.xyz\/blog\/files\/uploads\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-2022-03-30-204757.jpg\" alt=\"\" class=\"aligncenter size-full wp-image-276\" srcset=\"https:\/\/bernd32.xyz\/blog\/wp-content\/uploads\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-2022-03-30-204757.jpg 323w, https:\/\/bernd32.xyz\/blog\/wp-content\/uploads\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-2022-03-30-204757-300x175.jpg 300w\" sizes=\"auto, (max-width: 323px) 100vw, 323px\" width=\"323\" height=\"188\" \/><\/p>\n<p>If everything was successful, proceed to the next part \u2013 setting up Shadowsocks. I recommend creating a snapshot of your VPS so that if something goes wrong, you can roll back. If something has gone wrong and the site does not load, it&#8217;s possible that you have misconfigured the firewall settings or that the iptables settings are conflicting with the UFW.You can try to return the default policies of iptables (<strong>DON&#8217;T DO IT IF EVERYTHING WORKS FINE SO FAR<\/strong>):<\/p>\n<pre class=\"prism line-numbers language-plain\" data-lang=\"Plain Text\"><code class=\" language-plain\" data-hcb-clip=\"15\">iptables --policy INPUT ACCEPT;\r\niptables --policy OUTPUT ACCEPT;\r\niptables --policy FORWARD ACCEPT;\r\niptables -Z;\r\niptables -F;\r\niptables -X;<\/code><\/pre>\n<p><strong>Setting up shadowsocks (ss)<\/strong><\/p>\n<p>Make the directory for SS binaries:<\/p>\n<p><code>mkdir \/etc\/ss-go<\/code><\/p>\n<p>Download SS binaries from GitHub:<\/p>\n<p><code>wget https:\/\/github.com\/shadowsocks\/go-shadowsocks2\/releases\/download\/v0.1.5\/shadowsocks2-linux.gz<\/code><\/p>\n<p>Unpack the archive:<\/p>\n<p><code>gzip -d shadowsocks2-linux.gz<\/code><\/p>\n<p>Move and rename the binary directory:<\/p>\n<p><code>mv shadowsocks2-linux \/etc\/ss-go\/ss-go<\/code><\/p>\n<p><span class=\"HwtZe\" jsaction=\"mouseup:Sxi9L,BR6jm; mousedown:qjlr0e\" jsname=\"jqKxS\" lang=\"en\"><span jsaction=\"agoMJf:PFBcW;MZfLnc:P7O7bd;nt4Alf:pvnm0e,pfE8Hb,PFBcW;B01qod:dJXsye;H1e5u:iXtTIf;lYIUJf:hij5Wb;bmeZHc:iURhpf;Oxj3Xe:qAKMYb,yaf12d\" jsname=\"txFAF\" class=\"jCAhz ChMk0b\" jscontroller=\"Gn4SMb\"><span class=\"ryNqvb\" jsaction=\"click:E6Tfl,GFf3ac,tMZCfe; contextmenu:Nqw7Te,QP7LD; mouseout:Nqw7Te; mouseover:E6Tfl,c2aHje\" jsname=\"W297wb\">Make the binary files executable:<\/span><\/span><\/span><\/p>\n<p><code>chmod +x \/etc\/ss-go\/ss-go<\/code><\/p>\n<p>Elevate permissions and allow it to occupy privileged ports:<\/p>\n<p><code>setcap \"cap_net_bind_service=+eip\" \/etc\/ss-go\/ss-go<\/code><\/p>\n<p><strong>Installing v2ray plugin:<\/strong><\/p>\n<p><span class=\"HwtZe\" jsaction=\"mouseup:Sxi9L,BR6jm; mousedown:qjlr0e\" jsname=\"jqKxS\" lang=\"en\"><span jsaction=\"agoMJf:PFBcW;MZfLnc:P7O7bd;nt4Alf:pvnm0e,pfE8Hb,PFBcW;B01qod:dJXsye;H1e5u:iXtTIf;lYIUJf:hij5Wb;bmeZHc:iURhpf;Oxj3Xe:qAKMYb,yaf12d\" jsname=\"txFAF\" class=\"jCAhz ChMk0b\" jscontroller=\"Gn4SMb\"><span class=\"ryNqvb\" jsaction=\"click:E6Tfl,GFf3ac,tMZCfe; contextmenu:Nqw7Te,QP7LD; mouseout:Nqw7Te; mouseover:E6Tfl,c2aHje\" jsname=\"W297wb\">Download the plugin (here instead of &#8220;v1.3.1\/v2ray-plugin-linux-amd64-v1.3.1.tar.gz&#8221; may be something else, the latest version is here: <a href=\"https:\/\/github.com\/shadowsocks\/v2ray-plugin\/releases\/latest\">https:\/\/github.com\/shadowsocks\/v2ray-plugin\/releases\/latest<\/a>)<br \/>\n<\/span><\/span><\/span><\/p>\n<p><code>wget https:\/\/github.com\/shadowsocks\/v2ray-plugin\/releases\/download\/v1.3.1\/v2ray-plugin-linux-amd64-v1.3.1.tar.gz<\/code><\/p>\n<p>Unpack the archive:<\/p>\n<p><code>tar -xf v2ray-plugin-linux-amd64-v1.3.1.tar.gz<\/code><\/p>\n<p>Rename and move:<\/p>\n<p><code>mv v2ray-plugin_linux_amd64 \/etc\/ss-go\/v2ray-plugin<\/code><\/p>\n<p>Set file capabilities for the plugin:<\/p>\n<p><code>setcap \"cap_net_bind_service=+eip\" \/etc\/ss-go\/v2ray-plugin<\/code><\/p>\n<p>Create ss-v2ray service file :<\/p>\n<p><code>nano \/etc\/systemd\/system\/ss-v2ray.service<\/code><\/p>\n<p>File contents (don&#8217;t forget to replace &lt;password&gt; with your actual password for shadowsocks):<\/p>\n<pre class=\"prism line-numbers language-bash\" data-lang=\"Bash\"><code class=\" language-bash\" data-hcb-clip=\"27\"><span class=\"token punctuation\">[<\/span>Unit<span class=\"token punctuation\">]<\/span>\r\nDescription<span class=\"token operator\">=<\/span>Go-shadowsocks2 with V2RAY-websocket obfuscation\r\nAfter<span class=\"token operator\">=<\/span>network.target\r\n \r\n<span class=\"token punctuation\">[<\/span>Service<span class=\"token punctuation\">]<\/span>\r\nType<span class=\"token operator\">=<\/span>simple\r\nUser<span class=\"token operator\">=<\/span>nobody\r\nGroup<span class=\"token operator\">=<\/span>nogroup\r\nLimitNOFILE<span class=\"token operator\">=<\/span>51200\r\nExecStart<span class=\"token operator\">=<\/span>\/etc\/ss-go\/ss-go -s localhost:8008 -password &lt;password&gt; -cipher AEAD_CHACHA20_POLY1305 -plugin \/etc\/ss-go\/v2ray-plugin -plugin-opts <span class=\"token string\">\"server;loglevel=none;path=\/anime\"<\/span>\r\n \r\n<span class=\"token punctuation\">[<\/span>Install<span class=\"token punctuation\">]<\/span>\r\nWantedBy<span class=\"token operator\">=<\/span>multi-user.target<\/code><\/pre>\n<p>Save the file and enable the service:<\/p>\n<p><code>systemctl enable ss-v2ray.service<\/code><\/p>\n<p><strong>Setting up shadowsocks client on Windows.<\/strong><\/p>\n<p>Download and install the latest version of shadowsocks client for Windows here: <a href=\"https:\/\/github.com\/shadowsocks\/shadowsocks-windows\/releases\">https:\/\/github.com\/shadowsocks\/shadowsocks-windows\/releases<\/a><\/p>\n<p>Download the latest version of v2ray plugin: <a href=\"https:\/\/github.com\/shadowsocks\/v2ray-plugin\/releases\">https:\/\/github.com\/shadowsocks\/v2ray-plugin\/releases<\/a><\/p>\n<p>Move the v2ray-plugin_windows_amd64.exe file to the same folder with the Shadowsocks.exe ss-client executable file.<\/p>\n<p><span class=\"HwtZe\" jsaction=\"mouseup:Sxi9L,BR6jm; mousedown:qjlr0e\" jsname=\"jqKxS\" lang=\"en\"><span jsaction=\"agoMJf:PFBcW;MZfLnc:P7O7bd;nt4Alf:pvnm0e,pfE8Hb,PFBcW;B01qod:dJXsye;H1e5u:iXtTIf;lYIUJf:hij5Wb;bmeZHc:iURhpf;Oxj3Xe:qAKMYb,yaf12d\" jsname=\"txFAF\" class=\"jCAhz ChMk0b\" jscontroller=\"Gn4SMb\"><span class=\"ryNqvb\" jsaction=\"click:E6Tfl,GFf3ac,tMZCfe; contextmenu:Nqw7Te,QP7LD; mouseout:Nqw7Te; mouseover:E6Tfl,c2aHje\" jsname=\"W297wb\">Enter the following data in the settings fields<\/span><\/span><\/span><\/p>\n<pre class=\"prism line-numbers language-plain\" data-lang=\"Plain Text\"><code class=\" language-plain\" data-hcb-clip=\"29\">server addr - &lt;domain&gt;\r\nserver port - 443\r\npassword - &lt;your password from previous steps&gt;\r\nencryption - chacha20-ietf-poly1305\r\nplugin program - v2ray-plugin_windows_amd64.exe\r\nplugin options - tls;host=&lt;domain&gt;;path=\/anime\r\nproxy port - local proxy port that will be used in browser, your system settings etc. (1080 by default)<\/code><\/pre>\n<p>It should be something like this:<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/bernd32.xyz\/blog\/files\/uploads\/\u0411\u0435\u0437-\u0438\u043c\u0435\u043d\u0438.png\" alt=\"\" class=\"aligncenter size-full wp-image-287\" srcset=\"https:\/\/bernd32.xyz\/blog\/wp-content\/uploads\/\u0411\u0435\u0437-\u0438\u043c\u0435\u043d\u0438.png 517w, https:\/\/bernd32.xyz\/blog\/wp-content\/uploads\/\u0411\u0435\u0437-\u0438\u043c\u0435\u043d\u0438-300x268.png 300w\" sizes=\"auto, (max-width: 517px) 100vw, 517px\" width=\"517\" height=\"462\" \/><\/p>\n<p><strong>Getting SSL let&#8217;s encrypt certificate using certbot:<\/strong><\/p>\n<pre class=\"prism line-numbers language-plain\" data-lang=\"Plain Text\"><code class=\" language-plain\" data-hcb-clip=\"30\">apt install snapd\r\nsnap install core\r\nsnap refresh core\r\nsnap install --classic certbot\r\nln -s \/snap\/bin\/certbot \/usr\/bin\/certbot\r\ncertbot --nginx<\/code><\/pre>\n<p>After that, the terminal should have a congratulation message, it will also show the path to the certificate:<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/bernd32.xyz\/blog\/files\/uploads\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-2022-03-31-103752-1024x571.jpg\" alt=\"\" class=\"aligncenter size-large wp-image-282\" srcset=\"https:\/\/bernd32.xyz\/blog\/wp-content\/uploads\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-2022-03-31-103752-1024x571.jpg 1024w, https:\/\/bernd32.xyz\/blog\/wp-content\/uploads\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-2022-03-31-103752-300x167.jpg 300w, https:\/\/bernd32.xyz\/blog\/wp-content\/uploads\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-2022-03-31-103752-768x428.jpg 768w, https:\/\/bernd32.xyz\/blog\/wp-content\/uploads\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-2022-03-31-103752.jpg 1054w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" width=\"1024\" height=\"571\" \/><\/p>\n<p>A few words about the renewal of the certificate. In theory, the certificate should be automatically updated by the certbot daemon sitting in the server processes, but if automatic renewal did not work for some reason, then you can do it manually with just one command:<\/p>\n<p><code>certbot renew <\/code><\/p>\n<p><span class=\"HwtZe\" jsaction=\"mouseup:Sxi9L,BR6jm; mousedown:qjlr0e\" jsname=\"jqKxS\" lang=\"en\"><span jsaction=\"agoMJf:PFBcW;MZfLnc:P7O7bd;nt4Alf:pvnm0e,pfE8Hb,PFBcW;B01qod:dJXsye;H1e5u:iXtTIf;lYIUJf:hij5Wb;bmeZHc:iURhpf;Oxj3Xe:qAKMYb,yaf12d\" jsname=\"txFAF\" class=\"jCAhz ChMk0b\" jscontroller=\"Gn4SMb\"><span class=\"ryNqvb\" jsaction=\"click:E6Tfl,GFf3ac,tMZCfe; contextmenu:Nqw7Te,QP7LD; mouseout:Nqw7Te; mouseover:E6Tfl,c2aHje\" jsname=\"W297wb\">If you have several domains and you need to renew the certificate for a specific domain, then the command will look something like this:<\/span><\/span><\/span><\/p>\n<p><code class=\" language-text\">certbot certonly --force-renew -d example.com<\/code><\/p>\n<p>Restart nginx:<\/p>\n<p><code>systemctl restart nginx<\/code><\/p>\n<p>Restart v2ray:<\/p>\n<p><code>systemctl restart ss-v2ray<\/code><\/p>\n<p><strong>Completing the setup of Cloudflare.<\/strong><\/p>\n<p>In the settings of your domain on cloudflare, in the SSL \/ TLS section, set Full (strict):<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/bernd32.xyz\/blog\/files\/uploads\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-2022-03-31-104411-1024x577.jpg\" alt=\"\" class=\"aligncenter size-large wp-image-284\" srcset=\"https:\/\/bernd32.xyz\/blog\/wp-content\/uploads\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-2022-03-31-104411-1024x577.jpg 1024w, https:\/\/bernd32.xyz\/blog\/wp-content\/uploads\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-2022-03-31-104411-300x169.jpg 300w, https:\/\/bernd32.xyz\/blog\/wp-content\/uploads\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-2022-03-31-104411-768x432.jpg 768w, https:\/\/bernd32.xyz\/blog\/wp-content\/uploads\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-2022-03-31-104411.jpg 1078w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" width=\"1024\" height=\"577\" \/><\/p>\n<p>Go to your site, make sure everything works:<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/bernd32.xyz\/blog\/files\/uploads\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-2022-03-31-104142.jpg\" alt=\"\" class=\"aligncenter size-full wp-image-283\" srcset=\"https:\/\/bernd32.xyz\/blog\/wp-content\/uploads\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-2022-03-31-104142.jpg 740w, https:\/\/bernd32.xyz\/blog\/wp-content\/uploads\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-2022-03-31-104142-300x280.jpg 300w\" sizes=\"auto, (max-width: 740px) 100vw, 740px\" width=\"740\" height=\"691\" \/><\/p>\n<p>Specify proxy settings in the applications that you want to proxy. For example, in Firefox it looks like this (don&#8217;t mind the &#8220;No proxy for&#8221; field:<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/bernd32.xyz\/blog\/files\/uploads\/\u0411\u0435\u0437-\u0438\u043c\u0435\u043d\u0438-1-898x1024.png\" alt=\"\" class=\"aligncenter size-large wp-image-288\" srcset=\"https:\/\/bernd32.xyz\/blog\/wp-content\/uploads\/\u0411\u0435\u0437-\u0438\u043c\u0435\u043d\u0438-1-898x1024.png 898w, https:\/\/bernd32.xyz\/blog\/wp-content\/uploads\/\u0411\u0435\u0437-\u0438\u043c\u0435\u043d\u0438-1-263x300.png 263w, https:\/\/bernd32.xyz\/blog\/wp-content\/uploads\/\u0411\u0435\u0437-\u0438\u043c\u0435\u043d\u0438-1-768x876.png 768w, https:\/\/bernd32.xyz\/blog\/wp-content\/uploads\/\u0411\u0435\u0437-\u0438\u043c\u0435\u043d\u0438-1.png 913w\" sizes=\"auto, (max-width: 898px) 100vw, 898px\" width=\"898\" height=\"1024\" \/><\/p>\n<p>You can also <a href=\"https:\/\/www.dummies.com\/article\/technology\/computers\/operating-systems\/windows\/windows-10\/how-to-set-up-a-proxy-in-windows-10-140262\/\">proxy the whole Windows<\/a> if you want.<\/p>\n<p>That&#8217;s it! If you go to your site, it should open with https. Now your ISP sees a legit https traffic from you to Cloudflare servers, and if Freenom decides to scan our domain, it will find our page (Freenom can take away the domain if the site on the domain is empty).<\/p>\n<p>&nbsp;<\/p>\n<p>[1] <em>Penney, Jonathon W.. 2017. &#8220;Internet surveillance, regulation, and chilling effects online: a comparative case study&#8221;. Internet Policy Review 6 (2). DOI:\u00a010.14763\/2017.2.692. https:\/\/policyreview.info\/articles\/analysis\/internet-surveillance-regulation-and-chilling-effects-online-comparative-case.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>English translation of my post, original version in Russian is here. Just a few words before we get started. You can skip this part if&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[19,18,7,15,14],"class_list":["post-324","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-debian","tag-english","tag-guide","tag-linux","tag-network"],"_links":{"self":[{"href":"https:\/\/bernd32.xyz\/blog\/index.php?rest_route=\/wp\/v2\/posts\/324","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bernd32.xyz\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bernd32.xyz\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bernd32.xyz\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bernd32.xyz\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=324"}],"version-history":[{"count":12,"href":"https:\/\/bernd32.xyz\/blog\/index.php?rest_route=\/wp\/v2\/posts\/324\/revisions"}],"predecessor-version":[{"id":343,"href":"https:\/\/bernd32.xyz\/blog\/index.php?rest_route=\/wp\/v2\/posts\/324\/revisions\/343"}],"wp:attachment":[{"href":"https:\/\/bernd32.xyz\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=324"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bernd32.xyz\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=324"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bernd32.xyz\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=324"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}