Jack Zhang
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # ShellVPN Client ## 用户登录 ![enter image description here](https://jhzhanglibrary.oss-cn-beijing.aliyuncs.com/public/login.png) - 调用 https://test-client-http-api.surfshell.io/auth/login 进行登录 - dan:是的 - 此版本已经没有记住下次自动登录选项,因此不需要保存 token - dan: 如果不保存 token 的话,用户重新启动 客户端程序 是不是需要重新登陆?如果不重启 客户端程序 的话,能不能保持登陆状态? - 点击 Forgot Password 打开浏览器跳转到指定 Url,哪个地址? - dan: https://surfshell.io/forgetpwd - 点击 Create Account 调到哪个地址? - dan: 打开浏览器,调用地址:https://surfshell.io/login ## 首页 ![enter image description here](https://jhzhanglibrary.oss-cn-beijing.aliyuncs.com/public/home.png) ### 首页用户信息 - 通过上一步登录获取的 token 调用 https://test-client-http-api.surfshell.io/auth/user-info 获取用户信息 - dan: 是的 - 根据用户信息显示邮件、是否 VIP、VIP 过期时间。如何判断 VIP,过期时间没到就是 VIP 吗? - dan: 是的,以过期时间是否到期,来判断是否是 VIP 用户 - 点击 "Renew" 跳转到哪个 URL? - dan: 打开浏览器,跳转:https://surfshell.io/login ### 首页线路列表 - 通过 https://test-client-http-api.surfshell.io/v1/channels/enabled 获取线路列表 - dan: 是的 - 这个地方不太清楚该怎么做?拿到线路列表后,类似于 Clashy 中的线路实时速度、代理服务器地址等等这些信息从哪里获取? - dan: 不需要做 clashy 的线路实时测速功能,需要做的内容: 1. 需要分组可折叠展开(如设计图) 2. 一级线路:一级线路图标,一级线路名称,默认隐藏的连接按钮(该按钮效果后面有详述)(如设计图)(目前一级线路只有 免费连接,和智能连接两条) 1. 免费线路:数据是服务端接口返回的 2. 智能连接:数据是本地写死的 3. 一级分组:分组图标,分组名,展开收起状态的指示器图标(如设计图) 4. 各分组下的二级线路: 1. 该分组的智能连接线路: 1. 线路名称 2. 线路信号强度的图标,信号强度是假的,写死的,这个图标找设计师要, 3. 默认隐藏的连接按钮(该按钮效果后面有详述)(如设计图) 2. 普通线路: 1. 线路名称 2. 线路信号强度的图标,信号强度是假的,写死的,这个图标找设计师要, 3. 默认隐藏的连接按钮(该按钮效果后面有详述)(如设计图) 5. 一级,二级线路的 默认隐藏的连接按钮:鼠标移入对应线路显示线框按钮,移入按钮显示选中效果,每条线路均如此(请参考设计图和注解) 6. 以上所有未特殊说明的 展示的信息的数据源,都来自 https://test-client-http-api.surfshell.io/v1/channels/enabled 接口返回的数据结构,你可以先了解一下数据解构,我们再讨论一下具体实现细节 - 点击 CONNECT 是和 Clashy 逻辑一样吗? - dan: - 我不是很清楚 Clashy 实现的细节,你能把 clash-core 是如何加载配置文件的这一块逻辑大致说一下吗?(这一块的逻辑应该是关键)是通过 /config 这个接口吗? - 我们这边设计的整体流程是: 1. 客户端请求 connect , 服务端返回 config 配置相关的数据 ,是json格式 2. 然后客户端再把这个配置相关的数据 传入我们定制的 clash-core 3. 我们定制的 clash-core 会解析这个配置数据,接着启动 clash 代理 ## 设置 ![enter image description here](https://jhzhanglibrary.oss-cn-beijing.aliyuncs.com/public/settings.png) - 这个几个选项我理解应该和 Clashy 一样都是本地操作 - dan: 是的 - 点击 Check for updates 通过 https://test-client-http-api.surfshell.io/latest-release 接口获取当前最新版本信息 - dan: 是的 - 但是我们所有的 API 相关域名都不只一个,因为我们需要保证一个域名被污染后用户也能正常访问,所以我们是打算加入多域名重试的机制: 1. 一个域名访问超时或者其他原因失败后,会请求一下个域名,直到所有域名都不能用,才会提示用户相关的错误 2. 我们会先在本地写死一批硬编码域名,用于首次请求硬编码域名,从服务端获取 动态域名列表(服务端可编辑) 3. 同时有接口用于从服务端获取动态域名列表 4. 客户端,首次启动会先用本地的硬编码域名去,请求服务端,获取一批 动态域名列表,然后以后都优先使用从服务端获取的这批动态域名列表去请求 API,本地的硬编码域名的使用优先级是最低的 - 官网跳转到:https://surfshell.io - dan: 是的 - 隐私条款: https://surfshell.io/privacy-policy - dan: 是的 - 服务协议:https://surfshell.io/terms-of-service - dan: 是的 ## 用于传入 clash-core 的 json 格式的配置的详情解释 - 配置文件样例: ```json { "Rule": [ "DOMAIN,test-client-http-api.surfshell.io,DIRECT", "DOMAIN,test-client-http-api.surfshell.io,DIRECT", "DOMAIN,client-http-api.cbab8f853234402bb8c9a2f72c514158.xyz,DIRECT", "DOMAIN-KEYWORD,momo,DIRECT", "DOMAIN-SUFFIX,ad.com,REJECT", "GEOIP,CN,DIRECT", "MATCH,Auto" ], "allow-lan": false, "data": "bZfpbXfxPPc9zkTGLVJ6J2kuK/tn0DDX1adnkV9ONvXfgzOPrYKyKV9Xkl43n3GhxR1H4+1QhkaBQVwMi9odlsgl7ZmK30NPSxtsE1JuB/Q1KpwL0OjlptN0kF+4UBLzvjm52ykqun+rncuaTRaw9Ovt9ZMnFaPici7Ro568HWF9mPeKZCfrb5igqnlkpXQURxbcRL3Bx+MlmthlAEzL6uz/PYkf1RzqDzXzoaUXLC9dEhP8IO2xqKfIgbUVG3RGkO6mieHeMPlO4qkbit907r3XdZsbB9uwUiUjWdHMABlQryIpbp1xhqlDQ3uQE7Pp7iAjtp8gIcHIMzhao41IfStTZ+9mf4PyL1Hz+H/Ip7eENCSa4jRnPHs5Hm5oqvXeFMx/0dz/YmZNwYqYVlaKRaDLVESRz7YfXRHfdb0T6l9MJusKTeI7LoWCyA6Jfu9xWlfuZ0jfFGIV6TZ8JdbHTkB+15t6uQaPwWL3S/YEK58=", "external-controller": "127.0.0.1:9090", "log-level": "debug", "mode": "Rule", "port": 7890, "socks-port": 7891 } ``` - 样例解释: 1. data 字段来自 connect 接口返回的加密数据 2. 除 data 字段以外的字段由客户端自行负责构建 3. Rule 字段: 1. 客户端有全局功能开关,无论是否打开全局功能,Rule 规则里面,我们所有的 API 相关域名都必须走 直连,而不是走代理(防止连上部分代理之后,API 无法正常请求, 因此需要客户端构建 Rule 配置的时候,把所有 API 域名相关的配置为直连,如样例所示) 2. 当全局功能打开时,Rule 规则仅包含: 1. API 域名相关的配置为直连规则 2. "MATCH,Auto" 4. 当全局功能关闭时,Rule 规则包含(如样例所示): 1. API 域名相关的配置为直连规则 2. "DOMAIN-KEYWORD,momo,DIRECT", 3. "DOMAIN-SUFFIX,ad.com,REJECT", 4. "GEOIP,CN,DIRECT", 5. "MATCH,Auto" 4. log-level 字段: 1. 测试版 日志级别设为 debug , 2. 正式版 日志级别设为 silent 5. external-controller, port,socks-port : 需要客户端将端口号各改成比较大的数字,避免和其他 clash 之类的客户端发生端口占用的冲突 6. allow-lan: 目前暂定为 false 7. 用于测试站的 clash-core, 和用于正式站的 clash-core 是分开的,目前发给你的是测试站的 clash-core, 等你需要正式站版本的时候,找我要 clash-core 正式站版本 8. 目前测试站不是所有线路都可用的,我测试过可以正常访问代理的线路是: 美国-1 HBO, 请用这条线路测试 ## 智能连接,免费线路,以及 connect 接口传参说明: 1. 免费线路:不用客户端特殊处理,和普通线路一样处理 2. 智能连接,包括 2 种: 1. 线路列表中放在顶部的: "智能连接 (全局)",对应全局 2. 每个线路一级分组里面,放在分组顶部的: "智能连接(分组名)",对应每个分组 3. 上述的智能连接,服务端都不会直接返回数据,需要客户端根据服务端返回各分组的数据信息自己行间接构造(信息在 https://develop.vpsstart.xyz/v1/channels/enabled 接口返回的结果中) 4. 智能连接,推荐的构造的规则,以及相关的 connect 接口参数传递规则: 1. "智能连接(全局)":对应关联 groupId = 0, 该 groupId 用于调用 connect 接口时传参 2. 各分组的,"智能连接(分组名)": 对应关联各分组的 groupId, 该 groupId 用于调用 connect 接口时传参 3. connect 接口: 1. 智能连接 将 groupId 传入 group 参数,channel 参数传空 2. 普通线路 将 channel id 传入 channel 参数, group 参数传空 ## clash-core 控制台返回的需要 提示用户 断开连接的 错误标识, 注意前后不包含空格: 1. Decode SurfshellConfig Failed (需提示用户配置文件解析错误) 2. Decrypt SurfshellConfig Failed (需提示用户解密错误) 3. bind: address already in use (需要提示用户端口已被占用) 4. 需要使用新的 clash-core ## clash-core 成功标识是 以下四行日志都出现且端口号正确: Start initial compatible provider proxy RESTful API listening at: 127.0.0.1:9090 (这个端口号需要确保和我们的配置指定端口号一致,该端口暂定:31879) HTTP proxy listening at: 127.0.0.1:7890 (这个端口号需要确保和我们的配置指定端口号一致,该端口暂定:31880) SOCKS proxy listening at: 127.0.0.1:7891 (这个端口号需要确保和我们的配置指定端口号一致,该端口暂定:31881)

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully