Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

功能:SIP008转SIP002 #366

Closed
wc7086 opened this issue Aug 19, 2021 · 3 comments · Fixed by #367
Closed

功能:SIP008转SIP002 #366

wc7086 opened this issue Aug 19, 2021 · 3 comments · Fixed by #367

Comments

@wc7086
Copy link

wc7086 commented Aug 19, 2021

SIP008手写比较方便,有些客户端只支持SIP002订阅,手动转换就很难受。

@zhongfly
Copy link
Contributor

转换类型选ss(sip002)即可
target=ss

@wc7086
Copy link
Author

wc7086 commented Aug 19, 2021

转换类型选ss(sip002)即可
target=ss

我的意思是把纯SIP008转成SIP002

@cubercsl
Copy link
Contributor

cubercsl commented Aug 23, 2021

The code here may cause the SIP008 subscription can not be converted correctly.

const char *section = json.HasMember("version") && json.HasMember("remarks") && json.HasMember("servers") ? "servers" : "configs";
if(!json.HasMember(section))
return;

This patch may be able to fix~

diff --git a/src/parser/subparser.cpp b/src/parser/subparser.cpp
index 487a29f..d846127 100644
--- a/src/parser/subparser.cpp
+++ b/src/parser/subparser.cpp
@@ -495,7 +495,7 @@ void explodeSSConf(std::string content, std::vector<Proxy> &nodes)
     json.Parse(content.data());
     if(json.HasParseError())
         return;
-    const char *section = json.HasMember("version") && json.HasMember("remarks") && json.HasMember("servers") ? "servers" : "configs";
+    const char *section = json.HasMember("version") && json.HasMember("servers") ? "servers" : "configs";
     if(!json.HasMember(section))
         return;
     GetMember(json, "remarks", group);

https://shadowsocks.org/en/wiki/SIP008-Online-Configuration-Delivery.html
shadowsocks/shadowsocks-org#89


Even so, we can only output base64-encoded SIP002 links by selecting the type as ss. There seems to be no relevant implementation on the backend. We may need another PR to solve this problem.

cubercsl added a commit to cubercsl/subconverter that referenced this issue Aug 23, 2021
fix tindy2013#366

The SIP008 subscription can not be converted correctly when the member "remarks" does not exist.
tindy2013 pushed a commit that referenced this issue Sep 1, 2021
fix #366

The SIP008 subscription can not be converted correctly when the member "remarks" does not exist.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants