Advertisements

How To Install V2ray Websocket(WS)+TLS+CDN on a VPS

Advertisements

What is v2ray?

V2ray or vmess protocol to be precise, is a sophisticated version of the famous Shadowsocks. At the core, v2ray is also based on SOCKS5 proxy. Normally, proxies lack encryption, and that’s what differentiates a VPN and a proxy. Shadowsocks is SOCKS5 proxy with an encryption, and vmess is the next gen Shadowsocks. 

Advertisements

The previous article was about simple v2ray with tcp protocol, and that was enough for that time. But recently my v2ray tcp servers got blocked. So I believe it is time to move to more complicated configurations of v2ray. 

This method is called v2ray+websocket+tls+cdn (sometimes nginx is also added, if you  prefer to add a website). As to my understanding, this method hides your VPS IP address behind an IP address from a major CDN provider like Cloudflare, and most ISPs do not block those IP addresses.

Update 2021:

As the developer of v2-ui, changed the v2ray panel to x-ui, which is based on xray core, this tutorial is updated accordingly. The new panel has some design and functionality changes. Most of the installation is same as before. The x-ui panel is only in Chinese right now, but you can use google translate to understand it.

Note: I will update screenshots later.

Choosing a VPS

You should:

  • Before making payment ping an IP address of the VPS provider
  • Prefer hourly billing VPS services
  • Prefer less popular VPS services
  • Check for ratings and user reviews
  • Prefer KVM virtualization
  • Use a VPN when using Putty or an alternative SSH programme, to prevent IP address blocking

I can suggest these VPS services:

  1. Vultr – hourly billing – starting from $3.5 per month – vultr.com (get a $100 bonus)
  2. DigitalOcean – hourly billing – starting from $5 per month – digitalocean.com (get a $100 bonus)
  3. RackNerd – monthly billing – starting from $2 per month (annual subscription) – racknerd.com
  4. Contabo – monthly billing – starting from € 3.99 per month  – contabo.com
  5. CloudCone – hourly billing – starting from $4.2 per month – cloudcone.com

Setting up v2ray ws+tls+cdn 

Thanks to the one-command script by sprov065, you can install v2ray easily, even if you are not familiar with Linux commands. 

You need to have at least Ubuntu 16, Debian 8 or CentOS 7. 

This guide will be for Ubuntu.

The setup consists of two parts. First, the v2ray script installation, and the second is getting a free SSL certificate from Let’s Encrypt for TLS, and enabling CDN from Cloudflare. The second part is only needed if you wish to use tls and cdn.

Part one – install the script

1. First make updates and upgrades, and install curl

sudo apt-get update -y   sudo apt-get upgrade -y  sudo apt install curl -y

2. Run the x-ui script

bash <(curl -Ls https://raw.githubusercontent.com/vaxilu/x-ui/master/install.sh)

And that is it for the installation part.

v2ui

Part two – get the SSL Certificates

You will need:

  • A domain name
  • A Cloudflare account
  • Point your nameservers to Cloudflare
  • Point your VPS IP to your domain name

To get an SSL certificate, you need a domain name (www.example.com), preferably a paid one from providers like namecheap or porkbun, and a Cloudflare account. Both Porkbun and Namecheap have free Whois Guard. When it comes to pricing, Porkbun has an upper hand, you can find domain names for under $3 per year. Please do check the renewal prices before purchasing a domain.

 1. Nameservers configurationWhen adding your domain name to your Cloudflare account, Cloudflare will ask you to redirect your nameservers. It will be something like this:

example1.ns.cloudflare.com
example2.ns.cloudflare.com

You need to copy those from Cloudflare to your domain name registrar (ex: namecheap.com). On Namecheap you can find it on Domain List > Manage > Nameservers. Change the DNS to Custom DNS and add Cloudflare nameservers. After a while, Cloudflare will inform you that the setup is done.,

cloudflare_account_setup
cloudflare_account_setup2
namecheap_DNS
2. Connecting your domain name to the VPS IP address

On Cloudflare,

Advertisements
Advertisements
  1. Go to DNS Management
  2. Press “Add Record”
  3. Type your sub-domain name or domain name to “Name”  (ex: write test for test.example.com or @ for example.com)
  4. Write your VPS IP to “IPv4 address”.
  5. Make sure the color of “Proxy status” is orange and says DNS Only.

Note: If you keep DNS only status after SSL configuration mentioned below, you will get v2ray+ws+tls. If you change it to Proxied, you will get v2ray+ws+tls+cdn.

And lastly change SSL/TLS mode to Full or Full (strict).

cloudflare_DNS_only
cloudflare_SSL
3. Getting SSL Certificate

Now SSH to your VPS using Putty. 

  1. Install certbot.
sudo apt install software-properties-common  sudo add-apt-repository ppa:certbot/certbot  sudo apt-get install certbot

 2. Use certbot to get SSL Certificate. Use your own email address and domain name.

sudo certbot certonly --standalone --preferred-challenges http --agree-tos --email your-email-address -d test.example.com 

3. If you get a note like “Congratulations!..”, it means that now you have SSL certificate for your  domain/sub-domain.

In the text you will find destinations of your certificate file and key file. Copy them, as you will need  them on web panel. It will be something like this:

/etc/letsencrypt/live/test.example.com/fullchain.pem
/etc/letsencrypt/live/test.example.com/privkey.pem

Note:

If you face errors and cannot get the certificate, please make sure that your firewall is listening to ports 80 and 443, you have pointed your VPS IP address to the domain name and the Cloudflare CDN is off.

4. Last, the SSL certificate expires in 90 days, to make sure to renew it before expiration. Here is a manual renewal command.

certbot renew --force-renewal
LetsEncrypt_SSL

Managing  v2ray

Adding a user

You can go to x-ui web panel typing your IP address and the port (54321) on a browser. By default, both login and password are admin. You can change them in the panel settings.

http://"your-ip-address":54321

To add a user, you need to go to “accounts”, press add button and fill in the blanks according to  your preferences.

  • Remark – here you can write anything you want
  • Protocol – vmess
  • Listening IP, Port, ID (UUID) and Alter ID generated automatically. You can change them manually, as well. It is advised to use port 443. 
  • Transport – ws (websocket)
  • Path – you can leave it the way it is or add anything you want
  • Turn on TLS
  • Domain – write your domain name or sub-domain name
  • You can choose certificate file path and copy the file paths, or copy the certificate and key directly to certificate file content
  • Copy and paste certificate and key file paths, respectively
  • Press “Add”

And that is it. You can add, edit, delete users within seconds, and check bandwidth usage using x-ui web-panel. 

You are not only limited to v2ray ws tls cdn with this web panel, you can configure and test various combinations of v2ray.

I would like to thank vaxilu and other developers for this easy v2ray multi-user management panel.  

webpanel_1
webpanel_2

Bonus

BBR script

If you think your v2ray has slow speed, or have an older Linux version on your VPS, you can use bbr script by teddysun, to install google bbr.

wget -N --no-check-certificate https://github.com/teddysun/across/raw/master/bbr.sh && chmod +x bbr.sh && bash bbr.sh

Installing v2ray to Your Devices

v2ray apps for Android

You can use v2ray on several apps on Android, and all of them are available for free Google Play.

  • v2RayNG
  • Clash for Android
  • NapsternetV

v2ray apps for iOS

You can use v2ray on several apps on your iPhone/iPad as well, most of the v2ray apps are paid apps, except for 91VPN.

  • ShadowRocket
  • Kitsunebi
  • Quantumult
  • i2Ray
  • Pepi
  • 91VPN
  • Pharos Pro
  • FairVPN

v2ray clients for Windows

For your Windows PC, you can choose one of these five v2ray Windows clients. And here is a download link for the three of them. There are also new softwares called Clash (download it here) and Qv2ray (download it here).

  • V2RayW
  • V2RayN
  • V2RayS
  • Clash
  • Qv2ray
  • Netch

v2ray clients for macOS

For your Mac, you can choose one of these four v2ray clients. Here is a download link for V2RayX and here for V2RayU. The newsest additions to the list are ClashX (Click here to download) and Qv2ray (download it here) for macOS. 

  • V2RayX
  • V2RayU
  • ClashX
  • Qv2ray

VPN services that offer v2ray

Sometimes IP blocks are so often that you may want a solution without a hassle and go for a paid option. If that is the case for you, Wannaflix and 12VPN offer v2ray, along with other VPN protocols.

Advertisements

14,783 thoughts on “How To Install V2ray Websocket(WS)+TLS+CDN on a VPS

  1. Hey! I’m at work browsing your blog from my new iphone
    4! Just wanted to say I love reading through your blog and look forward to all your posts!
    Keep up the fantastic work!

  2. After looking into a few of the articles on your web site, I honestly appreciate your technique of blogging.
    I added it to my bookmark site list and will be checking back soon. Take a look
    at my web site too and let me know what you think.

  3. I’m really impressed with your writing skills as well as with the layout on your weblog.

    Is this a paid theme or did you modify it yourself?
    Either way keep up the nice quality writing, it is rare to see a great blog like
    this one today.

  4. Thank you a bunch for sharing this with all of us you really recognise
    what you are speaking about! Bookmarked. Kindly also consult with my site =).
    We could have a link exchange agreement between us

  5. Я считаю, что Вы ошибаетесь. Могу это доказать. Пишите мне в PM.


    хоть книги не читай… блэкджек играет на детском саксофоне, как играть блэкджек в карты и https://championsleage.review/wiki/%D0%92_%D0%9A%D0%B0%D1%87%D0%B5%D1%81%D1%82%D0%B2%D0%B5_%D0%9A%D0%BE%D0%B3%D0%BE_%D0%98%D0%B3%D1%80%D0%B0%D1%82%D1%8C_%D0%92_%D0%91%D0%BB%D1%8D%D0%BA%D0%B4%D0%B6%D0%B5%D0%BA_%D0%98_%D0%92%D1%8B%D0%B8%D0%B3%D1%80%D1%8B%D0%B2%D0%B0%D1%82%D1%8C блэкджек играть i

  6. Oh my goodness! Impressive article dude! Many thanks, However I am going through troubles with your RSS.
    I don’t understand the reason why I can’t subscribe to it.

    Is there anyone else getting identical RSS issues? Anybody who knows the
    solution will you kindly respond? Thanks!!

  7. Thank you for another fantastic post. The place else may
    just anyone get that type of information in such a perfect approach of writing?
    I have a presentation next week, and I am at the search for such information.

  8. Pretty section of content. I just stumbled upon your web site and in accession capital to assert that I acquire actually enjoyed account your blog posts.
    Anyway I’ll be subscribing to your augment and even I achievement you access consistently quickly.

  9. Thanks on your marvelous posting! I really enjoyed reading
    it, you can be a great author.I will be sure to bookmark your blog and will often come
    back from now on. I want to encourage you continue your great work, have a nice holiday weekend!

  10. Wow that was strange. I just wrote an really long comment but after I clicked submit my comment didn’t show up.
    Grrrr… well I’m not writing all that over again.
    Regardless, just wanted to say wonderful blog!

  11. Luar biasa! Ini sebenarnya luar biasa posting, saya punya banyak ide yang jelas
    tentang dari artikel ini. saya untuk mengambil RSS feed Anda agar tetap terkini dengan pos yang akan datang.
    Terima kasih banyak dan tolong lanjutkan pekerjaan menghargai.|
    Bermanfaat info. Beruntung saya Saya menemukan situs web
    Anda secara tidak sengaja, dan Saya terkejut mengapa perubahan nasib ini tidak terjadi sebelumnya!
    Saya menandainya.|
    Apakah Anda memiliki masalah spam di blog ini; Saya juga seorang blogger, dan saya ingin tahu situasi Anda; banyak dari kita telah mengembangkan beberapa prosedur yang bagus
    dan kami ingin menukar strategi dengan lain , kenapa tidak tembak saya email jika
    tertarik.|
    Ini sangat menarik, Kamu blogger yang sangat terampil.
    Saya telah bergabung dengan feed Anda dan berharap
    untuk mencari lebih banyak postingan luar biasa
    Anda. Juga, Saya telah membagikan situs web Anda di jejaring sosial saya!|
    Saya percaya semuanya diterbitkan sebenarnya sangat logis.
    Namun, pertimbangkan ini, misalkan Anda menulis
    judul yang lebih menarik? Maksud saya, saya tidak ingin memberi tahu Anda cara menjalankan blog Anda, tetapi
    misal Anda menambahkan a headline yang membuat orang ingin lebih?

    Maksud saya How To Install V2ray Websocket(WS)+TLS+CDN on a
    VPS – CoronaTutorials agak polos. Anda harus melirik di halaman depan Yahoo dan melihat bagaimana mereka membuat posting titles untuk ambil orang tertarik.
    Anda dapat mencoba menambahkan video atau gambar terkait atau
    dua untuk mendapatkan pembaca tertarik tentang apa yang Anda telah
    ditulis. Menurut pendapat saya, itu bisa membawa situs web Anda sedikit lebih menarik.|
    Fantastis situs web yang Anda miliki di sini, tetapi saya ingin tahu
    apakah Anda mengetahui papan diskusi yang mencakup topik
    yang sama dibahas di sini? Saya sangat suka untuk menjadi bagian dari komunitas tempat saya bisa
    mendapatkan masukan dari berpengalaman lainnya } orang yang memiliki minat yang
    sama. Jika Anda memiliki rekomendasi, beri tahu saya.
    Terima kasih!|
    Halo sangat keren situs web!! Pria .. Luar biasa ..
    Luar biasa .. Saya akan menandai situs web Anda dan mengambil feed tambahan? Saya senang menemukan banyak berguna info di sini di kirim, kami ingin mengembangkan ekstra
    teknik dalam hal ini, terima kasih telah berbagi. . . .

    . .|
    Hari ini, saya pergi ke tepi pantai bersama anak-anak saya.

    Saya menemukan kerang laut dan memberikannya kepada putri saya yang berusia 4 tahun dan berkata, “Kamu dapat mendengar lautan jika kamu meletakkannya di telingamu.” Dia meletakkan cangkang ke telinganya dan berteriak.
    Ada kelomang di dalamnya dan menjepit telinganya. Dia tidak pernah ingin kembali!
    LoL Saya tahu ini sepenuhnya di luar topik tetapi saya harus memberi tahu seseorang!|
    Teruslah menulis, kerja bagus!|
    Hei, saya tahu ini di luar topik tapi saya bertanya-tanyang jika Anda mengetahui widget apa pun yang dapat
    saya tambahkan ke blog saya yang secara otomatis men-tweet pembaruan twitter terbaru saya.

    Saya telah mencari plug-in seperti ini selama beberapa waktu dan berharap
    mungkin Anda akan memiliki pengalaman dengan hal seperti ini.

    Tolong beri tahu saya jika Anda mengalami sesuatu.
    Saya sangat menikmati membaca blog Anda dan saya menantikan pembaruan baru Anda.|
    Saat ini tampaknya seperti Expression Engine adalah platform blogging terbaik tersedia sekarang juga.
    (dari apa yang saya baca) Apakah itu yang kamu gunakan di blogmu?|
    Aduh, ini sangat postingan bagus. Menemukan waktu dan upaya nyata untuk menghasilkan bagus
    artikel… tapi apa yang bisa saya katakan… Saya menunda-nunda banyak sekali dan tidak berhasil mendapatkan apa pun selesai.|
    Wow itu aneh. Saya baru saja menulis komentar yang sangat panjang
    tetapi setelah saya mengklik kirim, komentar saya tidak
    muncul. Grrrr… baik saya tidak menulis semua itu lagi.
    Bagaimanapun, hanya ingin mengatakan blog luar biasa!|
    WOW apa yang saya cari. Datang ke sini dengan mencari Uang Asli|
    Luar biasa artikel. Terus menulis info semacam itu di blog Anda.

    Saya sangat terkesan dengan itu.
    Hai di sana, Anda telah melakukan pekerjaan luar biasa.
    Saya akan pasti menggalinya dan untuk bagian saya menyarankan kepada teman-teman saya.
    Saya percaya diri mereka akan mendapat manfaat dari situs ini.|
    Bisakah saya hanya mengatakan apa kenyamanan untuk menemukan seseorang yang sebenarnya mengerti apa mereka berbicara tentang online.
    Anda sebenarnya memahami cara membawa masalah ke terang dan menjadikannya penting.
    Lebih banyak orang perlu baca ini dan pahami
    sisi ini dari kisah Anda. Saya terkejut kamu tidak lebih populer karena kamu pasti memiliki hadiah.|
    Hari ini, ketika saya sedang bekerja, saudara perempuan saya
    mencuri apple ipad saya dan menguji untuk melihat apakah
    dapat bertahan dalam empat puluh foot drop, supaya dia bisa jadi sensasi youtube.
    iPad saya sekarang rusak dan dia memiliki 83 tampilan.
    Saya tahu ini sepenuhnya di luar topik tetapi saya harus membaginya dengan seseorang!|
    Halo! Apakah Anda keberatan jika saya membagikan blog Anda
    dengan grup twitter saya? Ada banyak orang yang menurut saya akan sangat menikmati konten Anda.
    Tolong beritahu saya. Cheers|
    Halo! Posting ini tidak bisa ditulis lebih baik! Membaca postingan ini mengingatkan saya pada teman sekamar lama!
    Dia selalu terus mengobrol tentang ini. Saya akan meneruskan artikel ini kepadanya.
    Cukup yakin dia akan membaca dengan baik. Terima kasih telah
    berbagi!|
    Halo! Tahukah Anda jika mereka membuat plugin untuk melindungi dari
    peretas? Saya agak paranoid tentang kehilangan semua yang telah saya kerjakan dengan keras.
    Ada rekomendasi?|
    Anda sebenarnya seorang webmaster baik. Situs memuat kecepatan luar biasa.

    Rasanya kamu melakukan trik unik. Selain itu, Isinya adalah masterpiece.
    Anda telah melakukan hebat pekerjaan pada hal ini subjek!|
    Halo! Saya tahu ini semacamf-topic namun Saya perlu untuk bertanya.

    Apakah menjalankan situs web yang mapan seperti milik Anda
    mengambil jumlah besar berfungsi? Saya benar-benar baru untuk blogging namun saya menulis di jurnal saya setiap
    hari. Saya ingin memulai sebuah blog sehingga saya akan dapat berbagi pengalaman dan perasaan saya secara online.
    Harap beri tahu saya jika Anda memiliki apa pun ide atau kiat untuk baru calon blogger.
    Terima kasih!|
    Hmm apakah ada orang lain yang mengalami
    masalah dengan gambar di pemuatan blog ini? Saya mencoba untuk menentukan apakah itu
    masalah di pihak saya atau apakah itu blog. Setiap masukan akan sangat dihargai.|
    Hai hanya ingin memberi Anda informasi brief dan memberi tahu Anda bahwa beberapa
    gambar tidak dimuat dengan benar. Saya tidak yakin mengapa tetapi
    saya pikir ini masalah penautan. Saya sudah mencobanya di dua browser yang berbeda dan keduanya
    menunjukkan hasil yang sama.|
    Halo luar biasa situs web! Apakah menjalankan blog mirip dengan ini
    memerlukan banyak berhasil? Saya punya sama sekali tidak pemahaman pemrograman namun saya dulu
    berharap untuk memulai blog saya sendiri
    soon. Pokoknya, harus Anda memiliki rekomendasi atau
    teknik untuk pemilik blog baru, silakan bagikan.
    Saya tahu ini di luar subjek namun Saya hanya ingin bertanya.
    Hargai!|
    Halo! Saya sedang bekerja menjelajahi blog Anda dari iphone 3gs baru saya!
    Hanya ingin mengatakan bahwa saya suka membaca blog Anda dan menantikan semua postingan Anda!
    Teruskan pekerjaan hebat!|
    Halo! Ini agak di luar topik, tetapi saya memerlukan beberapa
    saran dari blog yang sudah mapan. Apakah berat untuk membuat blog Anda
    sendiri? Saya tidak terlalu teknis tetapi saya dapat memecahkan masalah dengan cukup cepat.
    Saya berpikir untuk membuat milik saya sendiri, tetapi saya tidak yakin harus
    memulai dari mana. Apakah Anda punya tips atau saran? Terima kasih|
    Halo! Apakah Anda menggunakan Twitter? Saya ingin mengikuti Anda jika itu oke.
    Saya benar-benar menikmati blog Anda dan menantikan pembaruan baru.|
    Hai disana, Anda telah melakukan pekerjaan luar biasa. Saya akan pasti menggalinya dan secara pribadi merekomendasikan kepada teman-teman saya.
    Saya yakin mereka akan mendapat manfaat dari situs web ini.|
    Halo! Tahukah Anda jika mereka membuat plugin untuk help dengan SEO?

    Saya mencoba membuat peringkat blog saya untuk beberapa kata kunci yang ditargetkan tetapi saya tidak melihat kesuksesan yang sangat baik.
    Jika Anda tahu ada tolong bagikan. Hargai!|
    Halo ini semacam di luar topik tapi saya ingin tahu apakah blog menggunakan editor WYSIWYG atau jika
    Anda harus membuat kode secara manual dengan HTML. Saya akan segera memulai
    blog tetapi tidak memiliki pengetahuan pengkodean jadi
    saya ingin mendapatkan saran dari seseorang yang
    berpengalaman. Bantuan apa pun akan sangat dihargai!|
    Ini adalah pertama kalinya saya berkunjungan cepat di sini dan saya
    benar-benar senang untuk membaca segalanya
    di tempat sendirian.|
    Ini seperti Anda membaca pikiran saya! Anda tampaknya
    tahu banyak tentang ini, seperti Anda menulis buku di dalamnya atau semacamnya.

    Saya pikir Anda dapat melakukannya dengan beberapa foto untuk mengarahkan pesan ke rumah sedikit, tetapi daripada
    itu, ini luar biasa blog. Bagus bacaan. Saya akan pasti akan kembali.|
    Wow, luar biasa! Sudah berapa lama Anda ngeblog? Anda membuat blogging terlihat mudah.
    Tampilan keseluruhan situs Anda hebat, apalagi kontennya!|
    Wow, luar biasa blog tata letak! Sudah berapa panjang pernahkah Anda
    blogging? Anda membuat blogging terlihat mudah. Seluruh tampilan situs web Anda luar biasa, sebagai rapi sebagai materi
    konten!
    }

  12. Hello there, just became alert to your blog through Google, and found that it’s really informative.
    I am gonna watch out for brussels. I will be
    grateful if you continue this in future. Lots of people will be benefited
    from your writing. Cheers!

  13. Attractive element of content. I simply stumbled upon your weblog and in accession capital to claim that I acquire actually loved
    account your blog posts. Anyway I’ll be subscribing to your augment and even I achievement you
    get right of entry to consistently rapidly.visit to see my page

  14. I was recommended this web site by my cousin. I am not sure whether this post is written by him as no one else
    know such detailed about my difficulty. You are incredible!

    Thanks!

  15. I just like the helpful info you provide on your articles.

    I’ll bookmark your blog and test once more here frequently.
    I’m quite certain I’ll be told many new stuff right right here!
    Best of luck for the following!

Leave a Reply

Your email address will not be published. Required fields are marked *

Advertisements