data-id="1190000004885864">
Project address: SurgeConfigGenerator
Every time you update the Surge configuration file, you need to download the existing configuration from the Internet, and then manually fill in the configuration information of your corresponding server. Sometimes you have to change the configuration. It is very troublesome to find a way to transfer data back to the mobile phone. Now there is Surge configuration generator to help you free yourself from the tedious configuration changes.
Principle
Use PHP to remotely download the automatically updated surge.conf
from the Internet, then replace the relevant fields according to the configuration in the configuration file config.php
, and return the configuration file with the corresponding fields changed.
Use Surge’s Download Configuration from URL
directly and fill in the generator address deployed on your server to easily update the configuration.
Configuration
Clone project:
<code>git clone https://github.com/yourtion/SurgeConfigGenerator.git</code>
Copy config.sample.php
to config.php
and modify it according to your actual situation.
<code>$config = array( // Suerge 在线配置文件地址 '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' ), // 代理服务器组配置 'group' => 'Proxy = select,🇭🇰HK,🇸🇬SG,🇯🇵JP,🇺🇸US,🇰🇷KR', // 请求时的验证密码(防止服务器信息泄露) 'passwd' => 'myPassword' ), ), );</code>
Among them surge
and server
can be configured with multiple groups, and which configuration is returned according to the GET parameters of the request.
Deployment
Upload the files in the download directory (index.php
, parse.php
) and your modified config.php
to a space that supports PHP, and the deployment is complete.
Use
Suppose you upload to the surge
directory of the server server.com
and the configuration file is as shown above, then the URL to obtain the corresponding configuration (Abclite_ADB
) server (Abclite1
) file is:
http://server.com/surge/?c/code>
Fill this URL into Surge’s Download Configuration from URL
and you’re done.
If you do not fill in
config
andaccount
, the first configuration will be loaded by default. The URL can be simply written as:http://server.com/surge/?passwd=myPassword
The above has introduced the Surge configuration generator, including surge content. I hope it will be helpful to friends who are interested in PHP tutorials.