Giter Site home page Giter Site logo

surgeconfiggenerator's Introduction

Surge配置生成器

每次更新 Surge 配置文件,都需要从网上下载网上已有的配置,再手动填写自己对应服务器的配置信息,改了配置有时候还要想办法传回手机,这样非常麻烦,现在有了 Surge 配置生成器,帮你从繁琐的改配置中释放出来。

因为涉及到你个人的代理服务(Shadowsock的用户信息)所以最好是部署在你自己的 PHP 空间上。

经过测试,在新浪的 SAE 上也可以正常使用(稍后更新更多部署教程)。

原理

使用 PHP 远程下载网上 自动更新的 surge.conf 再根据配置文件 config.php 中的配置替换相关字段,并返回已经更改好相应字段的配置文件。

直接使用 Surge 的 Download Configuration from URL 填入部署在你服务器的生成器地址即可方便的更新配置。

配置

复制 config.sample.phpconfig.php,并根据你实际情况进行修改。

$config = array(
  // Surge 在线配置文件地址
  'surge' => array(
    'Abclite_ADB' => 'http://abclite.cn/Abclite_ADB.conf',
    'Abclite' => 'http://abclite.cn/Abclite.conf'
  ),
  // 你的服务器内容
  'server' => array(
    'Abclite1' => array(
      // 代理服务器列表
      'proxy' => array(
        '🇭🇰HK = custom,abclite.cn,10000,rc4-md5,abclite.cn,http://abclite.cn/SSEncrypt.module',
        '🇸🇬SG = custom,abclite.cn,10000,rc4-md5,abclite.cn,http://abclite.cn/SSEncrypt.module',
        '🇯🇵JP = custom,abclite.cn,10000,rc4-md5,abclite.cn,http://abclite.cn/SSEncrypt.module',
        '🇺🇸US = custom,abclite.cn,10000,rc4-md5,abclite.cn,http://abclite.cn/SSEncrypt.module',
        '🇰🇷KR = custom,abclite.cn,10000,rc4-md5,abclite.cn,http://abclite.cn/SSEncrypt.module'
      ),
      // 请求时的验证密码(防止服务器信息泄露)
      'passwd' => 'myPassword'
    ),
  ),
);

其中 surgeserver 可以配置多组,根据请求的 GET 参数确定返回哪个配置。

部署

把下载目录中的文件(index.phpparse.php)以及你修改好的 config.php 一起上传到一个支持 PHP 的空间,部署就完成了。

使用

假设你上传到服务器 server.comsurge 目录,配置文件如上所示,那么获取对应配置(Abclite_ADB)服务器(Abclite1)文件的网址就是:

http://server.com/surge/?config=Abclite_ADB&account=Abclite1&passwd=myPassword

将该网址填入 Surge 的 Download Configuration from URL 就完成了。

如果不填写 configaccount 会默认加载第一个配置,URL 可以简单写成:http://server.com/surge/?passwd=myPassword

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.