Coder Social home page Coder Social logo

v2ray-haproxy-docker's Introduction

V2Ray installer for a two VPS setup

This project is a bash script that aims to setup a V2Ray Proxy on a Linux servers, as easily as possible!

V2fly (a community-driven edition of V2Ray) is not a proxy itself, it's a modular platform for proxies that make it possible to setup different combinations of Proxy Protocls (like ShadowSocks, Vmess, Vless, Trojan,...) and Transports (like TCP, Websocket(ws), TLS, HTTP2 ...). Currently this combinations are the default ones: vmess-ws, shadowsocks-ws, vless-ws and vless-ws-tls.

Note: Since these transports overlap, you might be using more than one of them at a time. For example vmess-ws-TLS uses vmess as proxy protocol, websocket as transport and wraps the whole thing in TLS for security.

Requirements

  • Two VPS servers. A domestic VPS hosted in your country and a non-domestic one hosted elsewhere.

  • docker and docker-compose should be installed and running on those servers. Instruction to install:

    • docker

    • docker-compose Download the binary (compatible with the installed docker engine in previous step) Install Docker Compose

*NOTE: If installed docker via snap, docker-compose is also installed with it.

Terminology

  • Upstream Server: A server that has free access to the Internet.
  • Bridge Server: A server that is available to clients and has access to the upstream server. HAProxy runs here. This server acts only as a layer4 TCP or layer7 HTTP relay(i.e recieves client request => forwards request to Upstream server => recieve response from upstream => forwards response to client )
  • Client: A user-side application with access to the bridge server.
(Client) <-> [ Bridge Server (HAProxy) ] <-> [ Upstream Server (V2Ray) ] <-> (Internet)

Usage

Server

Clone the repo and execute the insall script on both bridge and upstream server. Answer the questions asked by the script and it will take care of the rest.

git clone https://github.com/UZziell/v2ray-haproxy-docker;
cd v2ray-haproxy-docker;
chmod +x v2ray-install.sh;
sudo ./v2ray-install.sh

Run the script again to uninstall the service. When the setup is over on the Upstream server, 3 QRCodes and URLs (vmess://, vless://, ss://) will be generated for clients. After added configs in the client app:

  • Those that end in Bridged should work all the time (i.e during internet shutdown)
  • Those configs that end with Direct, connect directly to the upstream server (the speed is better but only works in "normal" times).

Client

Install the appropriate app from the list below and add the server by scanning the QRCode or using the link.

VMess and Vless Protocol

In theory any v2ray client should work.

Tested clients apps:

Shadowsocks Protocol

These are recommended client apps:

P.S.

This repository is kind of forked from v2ray-docker-compose . Regards to @miladrahimi and other contributors.

(back to top)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.