Skip to content

jackyiero/Herokuvps

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

v2ray-heroku

是我面向新手写的教程 【金山文档】 Heroku搭建教程 https://kdocs.cn/l/cuGOXoYA2DwO

【金山文档】 申请Freenom域名的正确做法 https://kdocs.cn/l/cmqB5kYnODzN

昨天CF域名大量被国内DNS污染

现在推出CloudFlare Workers 被墙解决方案

【金山文档】 CloudFlare Workers 被墙解决方案 https://kdocs.cn/l/cp7ppdbff6Yw

https://dashboard.heroku.com/new?template=

heroku上部署v2ray

  • 支持VMess和VLESS两种协议
  • 支持自定义websocket路径
  • 伪装首页(3D元素周期表)
  • HTML5测速
  • 使用v2ray最新版构建

请求/,返回3D元素周期表

image

请求/speedtest/,html5-speedtest测速页面

image

请求/test/,文件下载速度测试

image

请求/ray(可配置)v2ray websocket路径

环境变量说明

名称 说明
PROTOCOL vmess
vless(可选)
协议:nginx+vmess+ws+tls或是nginx+vless+ws+tls
UUID uuid在线生成器 用户主ID
WS_PATH 默认为/ray 路径,请勿使用/speedtest//test 等已经被占用的请求路径

进阶

heorku可以绑卡(应用一直在线,不扣费),绑定域名,套cf,uptimerobot 定时访问防止休眠(只监控CF Workers反代地址好了,不然几个账户一起监控没几天就把时间耗完了)

CloudFlare Workers反代代码(可分别用两个账号的应用程序名(PROTOCOLUUIDWS_PATH保持一致),单双号天分别执行,那一个月就有550+550小时)

CloudFlare Workers单账户反代代码
addEventListener(
    "fetch",event => {
        let url=new URL(event.request.url);
        url.hostname="appname.herokuapp.com";
        let request=new Request(url,event.request);
        event. respondWith(
            fetch(request)
        )
    }
)
CloudFlare Workers单双日轮换反代代码
const SingleDay = 'app0.herokuapp.com'
const DoubleDay = 'app1.herokuapp.com'
addEventListener(
    "fetch",event => {
    
        let nd = new Date();
        if (nd.getDate()%2) {
            host = SingleDay
        } else {
            host = DoubleDay
        }
        
        let url=new URL(event.request.url);
        url.hostname=host;
        let request=new Request(url,event.request);
        event. respondWith(
            fetch(request)
        )
    }
)
CloudFlare Workers每五天轮换一遍式反代代码
const Day0 = 'app0.herokuapp.com'
const Day1 = 'app1.herokuapp.com'
const Day2 = 'app2.herokuapp.com'
const Day3 = 'app3.herokuapp.com'
const Day4 = 'app4.herokuapp.com'
addEventListener(
    "fetch",event => {
    
        let nd = new Date();
        let day = nd.getDate() % 5;
        if (day === 0) {
            host = Day0
        } else if (day === 1) {
            host = Day1
        } else if (day === 2) {
            host = Day2
        } else if (day === 3){
            host = Day3
        } else if (day === 4){
            host = Day4
        } else {
            host = Day1
        }
        
        let url=new URL(event.request.url);
        url.hostname=host;
        let request=new Request(url,event.request);
        event. respondWith(
            fetch(request)
        )
    }
)
CloudFlare Workers一周轮换反代代码
const Day0 = 'app0.herokuapp.com'
const Day1 = 'app1.herokuapp.com'
const Day2 = 'app2.herokuapp.com'
const Day3 = 'app3.herokuapp.com'
const Day4 = 'app4.herokuapp.com'
const Day5 = 'app5.herokuapp.com'
const Day6 = 'app6.herokuapp.com'
addEventListener(
    "fetch",event => {
    
        let nd = new Date();
        let day = nd.getDay();
        if (day === 0) {
            host = Day0
        } else if (day === 1) {
            host = Day1
        } else if (day === 2) {
            host = Day2
        } else if (day === 3){
            host = Day3
        } else if (day === 4) {
            host = Day4
        } else if (day === 5) {
            host = Day5
        } else if (day === 6) {
            host = Day6
        } else {
            host = Day1
        }
        
        let url=new URL(event.request.url);
        url.hostname=host;
        let request=new Request(url,event.request);
        event. respondWith(
            fetch(request)
        )
    }
)

客户端配置

  - name: "yourName"
    type: vmess
    server: yourName.workers.dev
    port: 443
    uuid: yourUuid
    alterId: 0
    cipher: auto
    udp: true
    tls: true
    #skip-cert-verify: true
    servername: yourName.workers.dev
    network: ws
    ws-path: /ray

最后感谢rptec、Lbingyi、DaoChen6 三位大佬的帮助和源码!!!

About

heroku上部署v2ray

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 51.1%
  • JavaScript 42.9%
  • PHP 2.6%
  • Shell 2.3%
  • Dockerfile 1.1%