Skip to content
This repository has been archived by the owner on Dec 9, 2021. It is now read-only.

Deploy V2ray To Heroku

onplus edited this page May 29, 2018 · 17 revisions

v2hero Build Status

部署方法

  1. 点击 创建HerokuAPP,配置服务器参数(appname和uuid,类似账号密码)

    create new app heroku

  2. Fork本项目,修改Dockerfile中ENV的VER=最新版本号,然后Gihub授权登录TravisCI https://travis-ci.org/profile ,选择fork的项目

    Travis

  3. 在项目的More options --> settings 添加Environment Variables:

    • HEROKU_APPNAME 步骤一的appname

    • HEROKU_EMAIL 注册heroku的邮箱

    • HEROKU_APIKEY API Key不是Heroku密码

    如果appname和邮箱存在特殊字符会导致build失败,需要用反斜杠 \ 转义

  apikey

  ENV

  1. 环境变量配置完成后重新开始TraviCi Build(没有自动开始时,可以修改自己项目的readme.md主动触发。)

  Travis Restart

  passed

  1. 查看HerokuAPP并重启一次(More-->restart),从more-->view logs确认启动成功

V2Ray started

  1. 配置V2Ray本地参数(模版参考vmess+ws+tls

    以v2rayN为例 https://www.v2ray.com/ui_client/

    v2rayN80  

    v2rayN443

    v2rayNG

    photo_2017-12-12_22-22-16

    https://toutyrater.github.io/advanced/websocket.html

    https://github.com/onplus/shadowsocks-heroku/issues/119

  2. 配置代理

    v2ray客户端一般都实现了内外分流,也可以配合插件细化管理https://github.com/gfwlist/gfwlist/wiki

  3. 测试服务器 https://github.com/onplus/shadowsocks-heroku/issues/119

  4. 更新服务端版本 https://github.com/v2ray/v2ray-core/releases/latest

    修改Dockerfile (VER=3.1)

ENV CONFIG_JSON1=none CONFIG_JSON2=none UUID=91cb66ba-a373-43a0-8169-33d4eeaeb857 CONFIG_JSON3=none CERT_PEM=none KEY_PEM=none VER=3.1

实现参考

https://github.com/v2ray/v2ray-core

https://github.com/wangyi2005/v2ray

Heroku https://devcenter.heroku.com/articles/container-registry-and-runtime

Travis-CI https://docs.travis-ci.com/user/docker