Skip to content

pansila/v2ray_heroku

Repository files navigation

Faster V2Ray Heroku App Image

Docker Pulls Docker Version Deploys Join the chat at https://gitter.im/pansila/v2ray_heroku Chat on discord

This repo builds v2ray docker image for heroku app and helps you deploy it.

中文文档

Attention

Free heroku app is overwhelmed and hence become slower over the time, please treat it with kid gloves. Stop being a Yang Mao Dang! Consider turning to a paid proxy service if you want a better user experience.

Deploy to Heroku In One Click

Deploy

A redirection will be made to collect the clicks statistics.

Why Another Docker Image?

It's inspired by v2ray-heroku which has some pitfalls.

  1. It downloads and deflates the latest v2ray everytime the heroku app boots, incuring a large latency to respondence to the initial proxy requests (Free Heroku App will force to stop after a while of idle).
  2. In order to reduce the image size, it's built from Alpine Linux 3.5 which is too old to have an up-to-date ca-certificates.
  3. No fine tuned template v2ray client config which makes novices hard to pick it up or easy to suffer from performance issues or privacy leakage problems.

This project builds the docker image with v2ray included against latest Alpine Linux and pushs to the docker hub.

Auto Update (Deploy)

The drawback this way is that the v2ray is not always up to date, to do so you need to:

  1. Fork this repo.
  2. Connect the forked repo to your heroku app in the heroku dashboard Deploy tab (choose the deployment method GitHub).
  3. Choose automatic deploy, tick Wait for CI to pass before deploy.
  4. Enable github actions in the actions tab as it's disabled when forked. The repo has a workflow that runs periodically to check the new release and triggers auto deploy when found one.

ENV Settings During Deployment

UUID

There is a default one, you can generate your own UUID at the end of the deploy if you are concern of the default one. Generate now.

DoH

Set to 'true' to enable proxy server side DoH (DNS over HTTPS) to protect your DNS queries, although it will increase a little delay to your DNS queries. 'false' to disable it.

v2ray Configurations

Please find v2ray config files in the repo. config.json.server is used by heroku app, config.json.client is for your v2ray client, please modify it to suit your case.

Security and Privacy

  1. All stuffs here are open sourced, you can check them line by line.
  2. V2ray is downloaded from the its offical github release page.
  3. You can check the SHA digest of the images in the building results and the docker image digest in the docker hub (Digest changes even with the same building stuffs for different docker image buildings).
  4. You can further check the building steps of a docker image in the docker hub.
  5. If you are still not convinced, you can fork the repositary, build the image by yourself and deploy it.

CDN Acceleration

addEventListener(
  "fetch", event => {
     let url = new URL(event.request.url);
     url.hostname = "<your app name>.herokuapp.com";
     let request = new Request(url, event.request);
     event.respondWith(
       fetch(request)
     )
  }
)

About

Build v2ray docker image for heroku app

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages