V2ray package - how to actually setup the proxy client on Manjaro and the server?

I am having small issue with shadowsocks-qt5 (no longer maintained) proxy software, memory usage seems high.
So i was checking for an alternative and seen @Twifty mentioned v2ray (platform for building proxies, may be faster than SS), installed the package using “pamac install v2ray”, found how to create .json config files per Install · Project V Official and include it as a -c parameter, but it does not seem to have GUI or not running as a service. So i guess i would have to manually setup cronjob/monitoring script or somehow discover how to setup the service and keep it always running. :-/
install instructions:
V2Ray - ArchWiki
Install · Project V Official
Installation | V2Ray Beginner's Guide
(not sure the difference between fly and ray, it is a mess)
there are some install scripts too:

  1. GitHub - v2fly/fhs-install-v2ray: Bash script for installing V2Ray in operating systems such as Debian / CentOS / Fedora / openSUSE that support systemd
  2. https://git.io/v2ray.sh (mentioned at How to Setup your own V2Ray – A Step by Step Guide – Privacy Melon )

so the questions is how to properly install Manjaro client and on Ubuntu or CentOS the server as a non stop running service. Anyone have opinion about this or even experience to share how to proceed?

As an alternative to shadowsocks/VPN i was also checking https://getoutline.org (in AUR i have found outline-client-appimage).

The client and server are the same program. V2fly is a community version that is still maintained.
If you want to install the v2ray client, you can install
v2ray
(maintained by v2fly), then configure config.json. Or you can use the GUI client: Qv2ray

As mentioned above, both client and server are the same package. The community version includes the systemd files required for running the client/server as a service. You don’t really need a GUI, just follow the guides on https://www.v2fly.org and manually edit the .json config file.

Install with pacman -S v2ray, edit the config at /etc/v2ray/config.json, test the config file with v2ray -test -config /etc/v2ray/config.json. To start the service use systemctl enable v2ray && systemctl start v2ray.

I have my config set to open 6 local SOCKS5 servers, each of which is routed to a different VPN on my remote servers. I’ve also installed the ‘SmartProxy’ extension in firefox with which I am able to quickly switch between VPNs. Previously, I had configured a system wide proxy with dockodemodoor, but with system updates and torrenting, my servers bandwidth limit was quickly exceeded.

If you have any further/specific questions, please just ask them here.

1 Like

Thanks for very helpful answer. My aim is not to proxify my PC internet traffic system-wide, but only for example my web browser traffic so i set 127.0.0.1:v2rayport, i am guessing it will work like that out of the box.

On the server i installed using command mentioned at GitHub - v2fly/fhs-install-v2ray: Bash script for installing V2Ray in operating systems such as Debian / CentOS / Fedora / openSUSE that support systemd
Then i had to manually define config.json files content:
Shadowsocks | V2Ray Beginner's Guide
server: /usr/local/etc/v2ray/config.json
client: /etc/v2ray/config.json
and restart at both ends: systemctl restart v2ray
and it works under the defined ports. I am wondering if i could do it easier. I have set two servers in single config.json and it appears that it from time to time switch between the two automatically, wondering if i can influence this switching manually or make one default and other fail-over or if/how load balance under shadowsocks protocol works - i do not insist to use SS protocol, that is just what i have used before)?

If you have two servers, then the best way to configure it is to create two local SOCKS proxies, one for each. You can quickly switch between them in your browser using an extension like ‘smartproxy’. It’s not currently possible to fail-over. The load balancing works by giving it list of outbounds, it will then cycle through them one by one (not randomly). To be honest though, it’s not something you would use.

Personally, I use the vmess protocol and have a fake website installed on my server. I also route my VPN through cloudflare (free) to prevent my servers IP from being blocked. I live in country which sniffs out and blocks VPN connections. OpenVPN and shadowsocks protocols are blocked within minutes.

I know there a lot of scripts out there for setting up a server, but be careful. I have come across quite a few that are malicious. If you are not setting up a fake website and only intent to use v2ray, it would be better to set it up manually or via the official install script.

I am guessing that maybe i need to modify my client /etc/v2ray/config.json somehow.

Sounds interesting. If you/anyone knows some tutorial for this, please link it. Regarding CF i found following, but understanding how it work and mainly how to use it is a different thing.

https://privacymelon.com/how-to-setup-v2ray-ws-tls-cdn/

All you need to do is create two inbound objects and two outbound objects. Make sure each has a “tag” field. Create a “routing” object with two rules, direct the inboundTag to the outboundTag.

To use cloudflare, you need to host a website on your server. I recommend using caddy as the server since it will automatically install the SSL certificates. It’s very very easy to use. You cannot use shadowsocks with CF though. I use the vmess protocol over a https connection.

Here is a guide: https://allinfa.com/v2ray-caddy-http2-websocket.html
It’s in Chinese but you can use google translate. However the guide uses caddy v1 which has a slightly different config for the newer v2. To set this up you would need to buy a domain name, but they are pretty cheap these days.

I think the .conf file example would be worth a thousand words ::

my workaround is following, done on client:

  1. mkdir -p /home/$(whoami)/scripts/;wget https://raw.githubusercontent.com/slrslr/Miscellaneous-bash-scripts/master/v2rayswitch -O /home/$(whoami)/scripts/v2rayswitch

update your server config file names in the script file:
nano /home/$(whoami)/scripts/v2rayswitch
Ctrl+X; Y; Enter

  1. chmod +x /home/$(whoami)/scripts/v2rayswitch;nano ~/.bashrc
    prepend new line:

alias v2rswitch=‘sudo /bin/bash /home/YOURUSERNAME/scripts/v2rayswitch’

on logout/login/restart computer, you can use commands like following to switch to different v2ray server:
$ v2rswitch
(it will ask to which server to switch)
$ v2rswitch serv1
(it will switch to server 1)