This is a Surge module that makes Surge to support SSR subscriptions. This module enables the conversion and merging of SSR subscriptions. It should be used in conjunction with the Sub-Store module. Combined with the Surge configuration file provided by this project, it can solve the problem that the Surge configuration cannot be modified when automatically synchronizing subscriptions and rules.
- Convert SSR subscription output from Sub-Store to Surge subscription
- Merge multiple Surge subscriptions (SubStore does not support the merging of proxy subscriptions with external proxy format)
- The SSR subscription link provided by the network service provider, Surge cannot be used directly
- Surge subscription will lead to configuration lock, which will make it impossible to add custom Proxy/custom rules/MITM certificates, etc.
- Organize the subscription through the Sub-Store module and filter out the available SSR nodes
- Use the SSR-Surge module to convert the SSR node subscription organized by Sub-Store into a Surge format subscription
- [Optional] Merge multiple Surge subscriptions using the SSR-Surge module
- [Optional] Use conf/unlock-sub.conf to implement subscription synchronization and Surge configuration can be modified
Pros
- Let Surge support SSR subscription
- Solve the problem that the configuration cannot be modified after the Surge subscription rule
- Support automatic synchronization of rules and subscriptions
- Group Proxy by region
- Support custom Proxy, which can be added manually through Surge UI
- Support modifying MITM certificate
Cons
- The initial configuration is relatively complicated
- Need to understand the basic usage of Surge configuration files
- SSR subscription uses the External Proxy Provider mechanism, which will consume a certain amount of memory (about tens of MB).
-
Open [Surge Main Window] -> [Settings] -> [Modules] -> [Install Modules from URL...]. , enter the following link
https://raw.githubusercontent.com/Peng-YM/Sub-Store/master/config/Surge.sgmodule
and enable the Sub-Store module -
In [Surge Menu] -> [Function] -> check [MitM] and [Script], if you don't do this step, the url https://sub.store will cannot open, which is not mentioned in Sub-Store's documentation, I also found it only after stepping on the pit.
- Open [Surge Main Window] -> [Settings] -> [Modules] -> [Install Modules from URL...]. , enter the following link
https://raw.githubusercontent.com/vangie/ssr-surge/main/conf/ssr.sgmodule
and enable the SSR-Surge module - Make sure that [MitM] and [Script] in [Surge Menu] -> [Function] have been checked
The following is the installation method under MacOS, other systems need to search by themselves
brew tap vangie/formula
brew install shadowsocksr-libev
Open https://sub.store in your browser and configure it. Without deeping into the configuration of the Sub-Store, the following points should be noted:
- The processed subscription link is in JSON format, and only contains SSR nodes and does not contain other nodes,
- URL format:
https://sub.store/download/<your-sub>
Do not choose the Surge output format, the Surge subscription result of the Sub-Store output is blank, and the content is as follows:
[
{
"type": "ssr",
"server": "",
"port": "",
"protocol": "auth_aes128_md5",
"cipher": "aes-128-cfb",
"obfs": "plain",
"password": "",
"name": "🇦🇺 AU-Linode",
"protocol-param": "",
"obfs-param": "",
"udp": true,
"tfo": true,
"skip-cert-verify": true
},
...
]
- Add the national flag or region name to the subscription name to facilitate subsequent grouping
SSR-Surge supports two RESTFul APIs
Convert Subscription:http://ssr.surge/conv?url=<url>
Merge Subscription:http://ssr.surge/merge?url=<url1>&url=<url2>&url=<url3>
Tips
- The above two URLs can be used in a nested manner, such as converting a subscription first and then merging it
<url>
,<url1>
, ... required URL Encoding
Work through an example
- Here is an example of the conversion process, assuming you have two subscriptions:
## SSR Subscription
https://sub-beta.ohmy.cat/e99fd21
## V2Ray Subscription
https://sub-beta.ohmy.cat/5754846
- The two links above, after a series of modifications and conversions through the Sub-Store, are
## SSR Subscription
https://sub.store/download/ssr-sub
## V2Ray Subscription
https://sub.store/download/v2ray-sub
- Convert
https://sub.store/download/ssr-sub
subscriptions via SSR-Surge
https://ssr.surge?conv?url=https%3A%2F%2Fsub.store%2Fdownload%2Fssr-sub
- Merge
https://ssr.surge?conv?url=https%3A%2F%2Fsub.store%2Fdownload%2Fssr-sub
andhttps://sub.store/download/v2ray-sub
subscriptions via SSR-Surge , the final subscription link is as follows
https://ssr.surge?merge?url=https%3A%2F%2Fssr.surge%3Fconv%3Furl%3Dhttps%253A%252F%252Fsub.store%252Fdownload%252Fssr-sub&url=https%3A%2F%2Fsub.store%2Fdownload%2Fv2ray-sub
- Download and edit the conf/unlock-sub.conf file, the
<your-sub-url>
Replace with the subscription address obtained above, and then put the conf/unlock-sub.conf file in Surge's configuration folder$(HOME)/Library/Application Support/Surge/Profiles
, and switch the Surge configuration to use unlock-sub.conf. - In order to simplify the configuration, the conf/unlock-sub.conf file has a built-in MitM certificate. Considering security, it is also recommended to regenerate a certificate by yourself.
If you want to contribute to SSR-Surge, please take a look at following contributing guide.
Initialize development environment
make setup
Build the source code to the dist
directory
make all
Install to the local Surge Profiles directory for easy local debugging
make install
SSR-Surge is fully MIT licensed.