{"action":"created","issue":{"url":"https://api.github.com/repos/breakwa11/shadowsocks-rss/issues/55","labels_url":"https://api.github.com/repos/breakwa11/shadowsocks-rss/issues/55/labels{/name}","comments_url":"https://api.github.com/repos/breakwa11/shadowsocks-rss/issues/55/comments","events_url":"https://api.github.com/repos/breakwa11/shadowsocks-rss/issues/55/events","html_url":"https://github.com/breakwa11/shadowsocks-rss/issues/55","id":106178702,"number":55,"title":"对新协议的格式讨论。","user":{"login":"wdhwg001","id":8943519,"avatar_url":"https://avatars.githubusercontent.com/u/8943519?v=3","gravatar_id":"","url":"https://api.github.com/users/wdhwg001","html_url":"https://github.com/wdhwg001","followers_url":"https://api.github.com/users/wdhwg001/followers","following_url":"https://api.github.com/users/wdhwg001/following{/other_user}","gists_url":"https://api.github.com/users/wdhwg001/gists{/gist_id}","starred_url":"https://api.github.com/users/wdhwg001/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wdhwg001/subscriptions","organizations_url":"https://api.github.com/users/wdhwg001/orgs","repos_url":"https://api.github.com/users/wdhwg001/repos","events_url":"https://api.github.com/users/wdhwg001/events{/privacy}","received_events_url":"https://api.github.com/users/wdhwg001/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-09-12T19:02:40Z","updated_at":"2015-09-14T05:34:10Z","closed_at":null,"body":"ss作为一个简单的协议，有着许多的遗留问题。\r\n比较突出的是对丢包的不可控，以及对错误数据的不可控。\r\n\r\n例如，在使用手机版twitter的时候，图片花屏率相当高。\r\n\r\n这一次@breakwa11 为ss引入了crc32机制，所以我想到了更新协议，改善历史遗留问题的可能。\r\n\r\n我抛个砖先，个人认为偏移环+crc是更可靠的方法：\r\n\r\n    偏移(1byte)|[原ss数据包|CRC|随机数据]\r\n    偏移使用密码进行简单的xor，以隐藏其数值较小的可能特征。\r\n    []中的数据，以第[偏移]位为首部，进行环形偏移。\r\n    包长度是不需要的，因为ss数据包本身是完整的。\r\n    同样的，因为ss是一个预先约定加密方式的代理，所以版本号也是不需要的。\r\n    偏移的存在极大的增加了数据的混乱程度，使得根据位数进行的分析从根本上变为了不可能，他们甚至连crc字段在哪里都无法确定。\r\n    服务器端以合适的随机数初始化偏移，并追加不太长的随机字串，发送数据包。\r\n    客户端的逻辑与服务器端相同，但请保证随机字串长度和偏移值均不相等，且两个随机字串中较小的不是较大的一部分。\r\n\r\n唔……本想设计一个把偏移进行递减以充当ttl的设计的，不过tcp本身就存在一定程度的顺序维持…\r\n\r\n以及题外话，我个人比较喜欢--relay-port和config中对relay-port的设置。转发至网站或者webserver或者其他服务这样的工作，应该交由其他的轮子去做，而不是ss…\r\n\r\n以及题外话v2.0，可以将旧协议服务器端开在新协议服务器端的relay-port上，以完成对旧协议的兼容，同时再把其他的轮子挂在旧协议服务器端的relay-port上完成转发。"},"comment":{"url":"https://api.github.com/repos/breakwa11/shadowsocks-rss/issues/comments/139965757","html_url":"https://github.com/breakwa11/shadowsocks-rss/issues/55#issuecomment-139965757","issue_url":"https://api.github.com/repos/breakwa11/shadowsocks-rss/issues/55","id":139965757,"user":{"login":"wdhwg001","id":8943519,"avatar_url":"https://avatars.githubusercontent.com/u/8943519?v=3","gravatar_id":"","url":"https://api.github.com/users/wdhwg001","html_url":"https://github.com/wdhwg001","followers_url":"https://api.github.com/users/wdhwg001/followers","following_url":"https://api.github.com/users/wdhwg001/following{/other_user}","gists_url":"https://api.github.com/users/wdhwg001/gists{/gist_id}","starred_url":"https://api.github.com/users/wdhwg001/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wdhwg001/subscriptions","organizations_url":"https://api.github.com/users/wdhwg001/orgs","repos_url":"https://api.github.com/users/wdhwg001/repos","events_url":"https://api.github.com/users/wdhwg001/events{/privacy}","received_events_url":"https://api.github.com/users/wdhwg001/received_events","type":"User","site_admin":false},"created_at":"2015-09-14T05:34:10Z","updated_at":"2015-09-14T05:34:10Z","body":"@breakwa11 也罢，我只是单方面的觉得…\r\n有偏移在弱密码下有优势\r\n只改首包无法解决一直以来ss缺乏校验等问题\r\n偏移可以替代crc，在性能较弱的情况下可以抽样检查，以改善性能\r\n\r\n不过性能一类的没什么验证就是耍流氓，所以真的没有必要就当做是我在脑补好了。\r\n"}}