` 标签和 一张JPEG图片作为后备( Andreas Bovens的 [ code snippet](https://dev.opera.com/articles/responsive-images/#different-image-types-use-case))来加载[ WebP 格式](https://www.smashingmagazine.com/2015/10/webp-images-and-performance/)图片。
117 | 或者使用 `Accrpt` 头部来和服务器交流。`Sketch ` 支持 WebP格式, WebP图片在Photoshop中可以使用 [ WebP plugin for Photoshop](http://telegraphics.com.au/sw/product/WebPFormat#webpformat) 来导出。[Other options are available](https://developers.google.com/speed/webp/docs/using)
118 |
119 | 
120 |
121 | *[Responsive Image Breakpoints Generator ](http://www.responsivebreakpoints.com/) 可以自动化图像和标记的生成*
122 |
123 | 你也可以使用 [client hints](https://www.smashingmagazine.com/2016/01/leaner-responsive-images-client-hints/) , 目前还在获得 [浏览器的支持](http://caniuse.com/#search=client-hints) 。没有足够的资源来支持响应式图片的复杂标记?使用 [ Responsive Image Breakpoints Generator ](http://www.responsivebreakpoints.com/) 或者像是[Cloudinary](http://cloudinary.com/documentation/api_and_access_identifiers)这样的服务来自动化图片的优化。此外,在许多情况下,单独使用 `srcset` 或 `sizes` 将会收获显著。 在Smashing杂志中,我们使用 后缀`-opt` 作为图像名称 - 例如, `brotli-compression-opt.png`, 这样只要图像包含这样的后缀,团队中的每个人都知道该图像被优化过了。
124 |
125 |
126 | #### 15. 让图像优化提高到下一个水平
127 | 当在你着手的一个登录页面中,非常紧急的需要一个特定的图像加载的足够的快,这时候你需要确保 JPEGs 通过 [ mozJPEG](https://github.com/mozilla/mozjpeg) (mozJPEG可以提高图片的初始渲染时间,通过操纵扫描级别)来优化 和 压缩,PNG 使用 [Pingo](http://css-ig.net/pingo) , GIF 使用 [ Lossy GIF](https://kornel.ski/lossygif), SVG 使用 [SVGOMG](https://jakearchibald.github.io/svgomg/)。模糊图片不必要的部分(通过应用高斯模糊过滤它们)来减少文件的体积,最终你甚至可以通过着手删除颜色或用黑白呈现图片进一步减少体积。对于背景图片,从Photoshop导出时候减少 0 ~ 10% 的质量也是完全可以接受的。
128 |
129 | 还不够?那好,也可以通过[multiple](http://csswizardry.com/2016/10/improving-perceived-performance-with-multiple-background-images/) [background](https://jmperezperez.com/medium-image-progressive-loading-placeholder/) [images](https://manu.ninja/dominant-colors-for-lazy-loading-images#tiny-thumbnails) [technique](https://css-tricks.com/the-blur-up-technique-for-loading-background-images/)(这里面每个单词都是一个链接)来提高图像的感觉性能。
130 |
131 |
132 | #### 16. web fonts 优化
133 |
134 | 你是用的web fonts很可能包含未使用的字形和额外的功能。如果你用的是 open-source fonts ,你可以向你的类型产生工厂要求一个web fonts子集或者自己[产生一个](https://www.fontsquirrel.com/tools/webfont-generator)来减少文件的体积。能支持WOFF2最好,对不支持的浏览器你也可以使用 WOFF 和OTF 作为降级处理的方案。另外,从Zach Leatherman’s [Comprehensive Guide to Font-Loading Strategies](https://www.zachleat.com/web/comprehensive-webfonts/) 方案 和 [service worker](https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0ahUKEwjB26L3i4jRAhVnxFQKHQ1RAB4QFggcMAA&url=https%3A%2F%2Fdeveloper.mozilla.org%2Fen-US%2Fdocs%2FWeb%2FAPI%2FService_Worker_API&usg=AFQjCNGcFYqcUoZIpTlw41JzGxE8aGJntw&sig2=HCdwMGD6vwAe8s0o2SAzFw)来永久缓存字体,来选择一种方案。需要快速的效果?Pixel Ambacht 有一个[快速的教程和案例分析](https://pixelambacht.nl/2016/font-awesome-fixed/)去获取指定的字体。
135 |
136 | 
137 |
138 | *Zach Leatherman’s Comprehensive Guide to Font-Loading Strategies 为web fonts交付提供了十几个的选项*
139 |
140 | 如果你不能从自己的服务上使用字体,而是依赖第三方,那就确保使用[ Web Font Loader](https://github.com/typekit/webfontloader)。 [FOUT 比 FOIT 好](https://www.filamentgroup.com/lab/font-events.html); 降级处理中,首先渲染文本,后异步加载字体——你也可以使用 [loadCSS](https://github.com/filamentgroup/loadCSS)。
141 | 你也应该[远离本地安装的系统字体](https://www.smashingmagazine.com/2015/11/using-system-ui-fonts-practical-guide/)。
142 |
143 |
144 | #### 17. 快速推送 critical CSS 样式
145 |
146 | 为了确保浏览器尽可能快的渲染你的页面,收集渲染页面第一个可见部分需的CSS(“critical CSS” or “above-the-fold CSS”)以及把他添加到 `` 标签的中来减少请求往返 ,已经变成通常做法。因为在 TCP 慢启动阶段交换的数据包大小有限制,所以你对于 critical CSS 大小的预算是 大约 14 KB。如果超过了这个预算,浏览器需要额外的 HTTP 往返去获取 critical CSS 样式。[CriticalCSS](https://github.com/filamentgroup/criticalCSS) 和 [Critical](https://github.com/addyosmani/critical) 可以确保你在预算之内。在每一个你使用的模版当中你都应该去做这件事。如果可能, 考虑使用 [conditional inlining approach](https://www.filamentgroup.com/lab/performance-rwd.html) ,其已被 the Filament Group 使用。
147 |
148 | 在 HTTP/2中,为了避免一个产生臃肿的HTML文件, critical CSS应该被存储在一个分离的CSS 文件中并通过服务器推送。但是服务器端推送支持并不一致,而且还有一些还存放方面的问题(查看 [Hooman Beheshti’s presentation](http://www.slideshare.net/Fastly/http2-what-no-one-is-telling-you))。事实上,这影响是负面的,会膨胀网络的缓冲区,导致文档当中真正的帧无法被递送。因为 TCP 的慢启动,服务器端推送 [在热连接上更加高效](https://docs.google.com/document/d/1K0NykTXBbbbTlv60t5MyJvXjqKGsCVNYHyLEXIxYMv0/edit)。 记住,`cache-digest` 这个高速缓存的新规范将会否定手动创建 `"cache-aware"` 服务的需求。
149 |
150 | #### 18. 使用 tree-shaking 和 code-splitting 减少有效负载
151 | [tree-shaking](https://medium.com/@roman01la/dead-code-elimination-and-tree-shaking-in-javascript-build-systems-fb8512c86edf) 是一种,通过只加载生产中确实被使用的代码,来整理你构建过程的方法。你可以使用 [Webpack2中清除未使用的部分](http://www.2ality.com/2015/12/webpack-tree-shaking.html), 也可以使用[UnCSS](https://github.com/giakki/uncss) 或者 [Helium](https://github.com/geuis/helium-css) 去删除未使用CSS样式。另外, 你可能会考虑怎么去 书写 [高效的 CSS 选择器](http://csswizardry.com/2011/09/writing-efficient-css-selectors/) 或是怎么[避免 冗长 低效的样式](https://benfrain.com/css-performance-revisited-selectors-bloat-expensive-styles/)。
152 |
153 | [Code-splitting ](https://webpack.github.io/docs/code-splitting.html) 是另一种Webpack特性,可以基于“chunks”分割你的代码然后按需加载这些代码块。一旦你在你的代码中确定了分割点,Webpack会全全负责这些依赖关系和输出文件。在应用发送请求的时候,这样基本上确保初始的下载足够小并且实现按需加载。
154 |
155 | 值得注意的是相比于 Browserify 输出结果 [ Rollup](http://rollupjs.org/)展现的更加优秀。当使用 Rollup时,我们会想要查看 [ Rollupify](https://github.com/nolanlawson/rollupify),它可以转化 ECMAScript 2015 modules 为一个大的 CommonJS module——因为取决于打包工具和模块加载系统的选择,小的模块会有[令人惊讶的高性能开销](https://nolanlawson.com/2016/08/15/the-cost-of-small-modules/)。
156 |
157 | #### 19. 提高渲染性能
158 | 使用[ CSS containment](http://caniuse.com/#search=contain) 隔离高代价的组件,比如限制一些画布外导航的布局 绘制的样式 或者第三方窗口小部件的样式的范围。确保在页面滚动或元素执行动画效果的时候,页面是没有滞后的,这样你就可以让页面每秒60帧一直保持一致。如果上面实现还是很困难,但至少让每秒的帧数保持在60 ~ 15的混合范围内。
159 | 使用 CSS 的 [will-change](http://caniuse.com/#feat=will-change) 去通知浏览器哪个元素或属性将要改变。
160 |
161 | 另外, 测试 [运行渲染性能](https://aerotwist.com/blog/my-performance-audit-workflow/#runtime-performance) (例如, [in DevTools](https://developers.google.com/web/tools/chrome-devtools/rendering-tools/))。在开始之前,请浏览 Paul Lewis 免费的 [ Udacity 课程对于浏览器渲染优化](https://www.udacity.com/course/browser-rendering-optimization--ud860) 的建议。我们还有一篇由 Sergey Chikuyonok 撰写的关于 如何[正确获取 GPU 动画](https://www.smashingmagazine.com/2016/12/gpu-animation-doing-it-right/)的文章。
162 |
163 | #### 20. 通过预热连接加速传输
164 | 使用 `skeleton screens`, 懒加载所有的高代价的组件,像是字体, JavaScript, 轮播, 媒体和 iframes。使用 [ resource hints](https://w3c.github.io/resource-hints) 中一些方法节约加载时间: [dns-prefetch ](http://caniuse.com/#search=dns-prefetch)(在后台执行 DNS 查找) ,[preconnect](http://www.caniuse.com/#search=preconnect) (告知浏览器在后台开始一些握手协议(DNS, TCP, TLS)的连接), [prefetch](http://caniuse.com/#search=prefetch) (要求浏览器去预取指定资源,是资源加载更快速), [ prerender](http://caniuse.com/#search=prerender) (告知浏览器在后台渲染特定的页面)和 [preload](https://www.smashingmagazine.com/2016/02/preload-what-is-it-good-for/) (预取一些尚未开始执行的资源,包括一些其他东西)。值得注意的是实践当中,因为取决于浏览器的支持情况, 推荐 `dns-prefetch` 而不是 `preconnect`,而且应当谨慎的使用 `prefetch` 和 `prerender` ——后者只能在你对用户下一步将会浏览什么很自信时候才去使用(例如,在一个购买流程当中的时候)。
165 |
166 | ### HTTP/2
167 | #### 21. 准备好迎接 HTTP/2
168 | 随着 Google 一直向着[更加安全的 web](https://security.googleblog.com/2016/09/moving-towards-more-secure-web.html) 发展 ,最终在 Chrome 中所有的 HTTP 网页将会被认为是“不安全”的,你将会需要去衡量是否继续在 HTTP/1.1 上做赌注,还是建立 [HTTP/2 环境](https://http2.github.io/faq/) 。 HTTP/2 已经被[很好的支持](http://caniuse.com/#search=http2)了。在大多数情况下,你最好使用它,这将是意义重大的,你迟早会把方向转移到 HTTP/2 的。最重要的是,通过 `service workers` 和 `server push` (至少长期)[性能将会有巨大的的飞跃](https://www.youtube.com/watch?v=RWLzUnESylc&t=1s&list=PLNYkxOF6rcIBTs2KPy1E6tIYaWoFcG3uj&index=25)。
169 |
170 | 
171 |
172 | *最终, Google 计划标记所有的 HTTP 页面为不安全的,改变 HTTP 网页原有的安全标志为红色的警告,示意为损坏的 HTTPS。*
173 |
174 | 缺点就是你需要去迁移到 HTTP/2 ,取决于使用 HTTP/1.1 用户数量有多大(就是使用旧版操作体统或使用旧版浏览器的用户),需要你发送不同的构建文件,这将要求你适应[不同的构建流程](https://rmurphey.com/blog/2015/11/25/building-for-http2) 。注意: 迁移和建立新的构建流程将会是棘手和费时的。文章剩余的部分,我将会假设你是正在切换或已经切换到 HTTP/2 了。
175 |
176 | #### 22. 正确部署 HTTP/2
177 | 其次,通过 [HTTP/2 提供资源](https://www.youtube.com/watch?v=yURLTwZ3ehk)
178 | 将是一次巨大的翻新,与以往获取资源的方式相去胜远。你需要在模块打包和并行加载好多小模块中做出比较好的权衡。
179 |
180 | 一方面,你也许想要避免一次获取全部的资源,而是将整个界面拆分成好多小模块,把他们作为构建过程的一部分压缩,可以参考 [ “scout” approach](https://rmurphey.com/blog/2015/11/25/building-for-http2) 和 并行加载。其中一个文件有改动的时候不用重新下载整个样式表或者JavaScript文件。
181 |
182 | 另一方面,打包依旧很重要,因为向浏览器发送很多小 JavaScript 文件将会存在很多问题。首先,压缩是受损的。使用 字符重用 (相关:LZW压缩算法)有利于 大 包 的压缩。而不利于分离的小 包 的压缩。这方面的标准也有一些标准,但现在离我们还是太远了。其次,浏览器并未对这方面的工作流进行优化。举个例子,Chrome 将会根据资源数触发相应数量的[inter-process communications](https://www.chromium.org/developers/design-documents/inter-process-communication)(IPCs) ,, 所以包含数百个资源将会有浏览器的运行成本。
183 |
184 | 
185 |
186 | *为了使用 HTTP/2 实现最佳效果, 参考 Chrome’s Jake Archibald 的建议,[逐步加载css](https://jakearchibald.com/2016/link-in-body/) *
187 |
188 | 你也可以尝试 [逐步加载css](https://jakearchibald.com/2016/link-in-body/)。明显的,你这样做对于 HTTP/1.1 用户是不友好的, 所以作为你部署流程的一部分,你需要对不同的浏览器产生不同的构建方式,当然事情也会变得略显复杂。你也可以放弃 [ HTTP/2 connection coalescing](https://daniel.haxx.se/blog/2016/08/18/http2-connection-coalescing/), 得益于 HTTP/2 ,允许你使用域分片,但是这个具体实现还是有点难度的。
189 |
190 | 怎么去做?如果你已运行在 HTTP/2, 作为妥协(对于旧版浏览器来说不算很坏),可以发送了大约10个包。当然对于自己的网站,还是需要实验和测试出合适的值是多少。
191 |
192 |
193 | #### 23. 确保服务的安全性
194 | 所有浏览器的都是依赖 TLS 实现 HTTP/2 的 ,所以你可能想要避免安全性警告或有些网页无法工作。再次检查你的 [正确设置安全性头部](https://securityheaders.io/) ,[消除已知漏洞](https://www.smashingmagazine.com/2016/01/eliminating-known-security-vulnerabilities-with-snyk/) , [检查你的证书](https://www.ssllabs.com/ssltest/)。
195 |
196 | 已经迁移到 HTTPS了吗?查阅 [The HTTPS-Only Standard](https://https.cio.gov/faq/) ,以获取完整的指南。另外,确保所有的外部插件和跟踪脚本通过 HTTPS 加载,跨域脚本是不被允许的,[HTTP Strict Transport Security headers](https://www.owasp.org/index.php/HTTP_Strict_Transport_Security_Cheat_Sheet) 和 [ Content Security Policy headers](https://content-security-policy.com/) 被正确设置。
197 |
198 | #### 24. 服务和 CNDs 支持 HTTP/2 ?
199 | 不同的服务和 CDNs 支持 HTTP/2 的程度是不一样的。使用 [ Is TLS Fast Yet?](https://istlsfastyet.com/)去查看符合你的选项,快速查看你服务的性能如何,支持哪些特性。
200 |
201 | 
202 |
203 | *[ Is TLS Fast Yet?](https://istlsfastyet.com/) 允许你查看当你切换到 HTTP/2 时 你的服务和CDNs支持的选项。*
204 |
205 | #### 25. Brotli or Zopfli compression
206 | 去年,Google [介绍](https://opensource.googleblog.com/2015/09/introducing-brotli-new-compression.html)了 [Brotli](https://github.com/google/brotli), 一个新的开源无损数据格式,已被Chrome, FireFox,Opera [广泛支持](http://caniuse.com/#search=brotli)。 实践中,Brotli 相比于 Gzip 和 Defalte 表现[更加有效](https://samsaffron.com/archive/2016/06/15/the-current-state-of-brotli-compression)。取决于设置,它可能会缓慢压缩,但是缓慢压缩最终导致高压缩率。而且,Brotli 解压是非常迅速的。因为是来源于Google的算法,那么对于浏览器只对用户浏览的HTTPS网页支持Brotli也就不奇怪了——好吧,其实里面也有一些技术上的原因。。。现今 Brotli 不是预先安装在大部分服务器上的,而且没有自编译的 NGINX 或 Ubuntu也不是那么容易安装 Brotli。然而,你甚至可以 [在不支持 Brotli 的CDNs上启用它](http://calendar.perfplanet.com/2016/enabling-brotli-even-on-cdns-that-dont-support-it-yet/)(使用的是 service worker 技术)。
207 |
208 |
209 | 或者,你可以去瞧瞧[ Zopfli 压缩算法](https://blog.codinghorror.com/zopfli-optimization-literally-free-bandwidth/),它可以把数据编码成 Deflate, Gzip,Zlib格式。任何传统的 Gzip压缩资源,将会从 Zopfli 改进的 Deflate 编码方式中受益,因为文件将会比以 Zlib 最大的压缩方式压缩的文件小 3% ~ 8%。值得一提的是,文件将花费80倍的时间来压缩。这就是为什么推荐对那些不是经常改动的文件使用 Zopfli 压缩。
210 |
211 | #### 26. 启用了 OCSP stapling 吗?
212 | 通过在你的服务器上[启用 OCSP stapling](https://www.digicert.com/enabling-ocsp-stapling.htm), 你可以加速 TLS 握手。`The Online Certificate Status Protocol` (OCSP)被 创建为替代 ` the Certificate Revocation List` (CRL) 的方案。这两个协议被用作检查 SSL 证书是否被撤销。然而,`the OCSP protocol` 不要求浏览器下载,而是在列表中搜索证书的相关信息,因此减少了握手中的请求时间。
213 |
214 | #### 27. 你已经采用 IPv6 了?
215 | 因为我们正在[耗尽 IPv4 空间](https://en.wikipedia.org/wiki/IPv4_address_exhaustion) ,主要的移动网络正在迅速的支持 IPv6(美国已经有 [50%](https://www.google.com/intl/en/ipv6/statistics.html#tab=ipv6-adoption&tab=ipv6-adoption) 的采用了 IPv6)。建议更新你的 DNS 到 IPv6,紧跟时代趋势。只需要确保网络提供 `dual-stack` 支持 —— 它允许 IPv6 和 IPv4 同时互不干涉的运行。但是终究,IPv6是不向后兼容的。而且,[研究显示](https://www.cloudflare.com/ipv6/) IPv6 凭借 neighbor discovery (NDP) 和 路由优化 让网站运行块 10% ~ 15%。
216 |
217 | #### 28. 启用了 HPACK 压缩?
218 | 如果你正在使用 HTTP/2 , 为了减少不必要的开销,再次检查是否启用了 HPACK 压缩 HTTP 响应头部。因为 HTTP/2 服务还是相对来说比较新的,他们不一定完全支持规范,使用 HPACK 就是一个例子。 [H2spec ](https://github.com/summerwind/h2spec) 是一个检查上述支持情况的比较好的工具。 [ HPACK works](https://www.keycdn.com/blog/http2-hpack-compression/).
219 |
220 | 
221 |
222 |
223 | *H2spec([View large version](https://www.smashingmagazine.com/wp-content/uploads/2016/12/h2spec-example-large-opt.png))*
224 |
225 | #### 29. 为缓存和网络降级启用 service workers 了?
226 |
227 | 任何对于网络的性能优化都不可能比用户机器上本地存储缓存来的快。如果你的网站启用了 HTTPS, 使用 [Pragmatist’s Guide to Service Workers](https://github.com/lyzadanger/pragmatist-service-worker)在 `service worker cache` 和 离线存储(甚至完全离线的页面) 中 缓存静态资源,这样可以从用户本机上检索资源,而不是去网络上请求。参考:Jake’s [Offline Cookbook](https://jakearchibald.com/2014/offline-cookbook/) 和 the free Udacity course [Offline Web Applications](https://www.udacity.com/course/offline-web-applications--ud899) 。浏览器支持吗?看[这里](http://caniuse.com/#search=serviceworker), 不管网络状况如何,这样的后备方案都是适用的。
228 |
229 |
230 | ### 测试和监控
231 | #### 30. 监控混合内容的警告
232 | 如果你最近已经从 HTTP 迁移到了HTTPS, 请务必使用工具[Report-URI.io.](https://report-uri.io/)监控主动的和被动的混合内容警告。你也可以为混合内容,使用 [ Mixed Content Scan](https://github.com/bramus/mixed-content-scan) 去扫描支持 HTTPS 的站点。
233 |
234 | #### 31. 在 DevTools 中优化了你的开发工作流吗?
235 | 挑选一个调试工具,然后点击每一个简单的按钮。请确保自己能理解怎么去分析渲染性能和 console 输出,还有怎么去调试 JavaScript 和编辑 CSS 样式。Umar Hansa 最近准备了一个(很大的)[slidedeck](https://umaar.github.io/devtools-optimise-your-web-development-workflow-2016/#/) 和 [talk](https://www.youtube.com/watch?v=N33lYfsAsoU) 覆盖了几十个隐藏的提示和技术,能帮助我们更好的在 DevTools 中调试和测试。
236 |
237 | #### 32. 你在代理浏览器和旧版浏览器中测试过吗?
238 | 在 Chrome 和 FireFox 中测试是不够的。研究你的网站是怎么在代理浏览器和旧版浏览器中工作的。例如, UC 浏览器 和 Opera Mini ,在亚洲占着[一定的市场份额](http://gs.statcounter.com/#mobile_browser-as-monthly-201511-201611)(高达 35%),测试你感兴趣的国家[网速的平均值](https://www.webworldwide.io/), 避免以后听说的时候被惊讶到。使用网络节流调节测试,来模仿高DPI的设备。[ BrowserStack](https://www.browserstack.com/),就是一个非常棒的工具,也可以在真实设备商测试。
239 |
240 | #### 33. 建立了持续的监控?
241 | 有一个有用的私有地实例 [WebPagetest](http://www.webpagetest.org/)可以快速无限制的被测试。建立一个可以自动报警的持续性能预算监控。设置你自己的用户时间标记去测试 监控业务特定的指标。查看使用 [SpeedCurve](https://speedcurve.com/) 监控随着时间推移的性能的改变,使用 [New Relic](https://newrelic.com/browser-monitoring) 得到 `WebPagetest `不能提供的数据。还有一些工具:[SpeedTracker](https://speedtracker.org/) ,[Lighthouse](https://github.com/GoogleChrome/lighthouse) , [Calibre](https://calibreapp.com/)。
242 |
243 | ### 快速获取:
244 | 这份清单还是相当全面的,完成所有的优化手段会需要相当一段时间的。所以,你只有1小时的时间,想去取得性能上显著的提升,应该怎么做?我们把它们合到 10 个 比较容易的方案上。当然,在你开始之前和完成之后,需要在 3G网络 和 有线网络中,分别测试 `start rendering time` 和 ` SpeedIndex ` 两个指标的值。
245 |
246 | 1. 你的目标是 `start rendering time` 在有线网络中小于 1 秒,在 3G 网络中小于 3 秒,和 ` SpeedIndex ` 值低于1000。然后优化 `start rendering time` 和 `time-to-interactive` 两个值。
247 | 2. 为你的模版准备 `critical CSS` ,将其包含在页面 ``标签内。(你的关键CSS大小预算是 14KB)。
248 | 3. 尽可能延迟和懒加载尽量多的 scripts ,以及你的和第三方的 scripts —— 特别是社交媒体按钮相关的,视频播放相关的和高代价的JavaScript。
249 | 4. 添加资源提示加速传输:`dns-lookup`, `preconnect`, `prefetch`, `preload` 和 `prerender`。
250 | 5. 添加 web fonts 子集以及异步加载它们(或只切换到系统字体)。
251 | 6. 优化图片,对关键页面图片使用 WebP 格式(像是登录页面)。
252 | 7. 检查是否正确设置 HTTP 缓存头部和安全性头部。
253 | 8. 在服务上启用 Brotli 或 Zopfli 压缩。(如果这不现实,也不要忘记 Gzip 压缩)
254 | 9. 如果 HTTP/2 可用,启用 HPACK 压缩 和 监控混合内容的警告。如果你运行了 LTS, 别忘了启用 OCSP stapling。
255 | 10. 如果可能,在 service worker 缓存中,缓存像是字体,样式,JavaScript,图片这样的资源——其实是,缓存越多越好!。
256 |
257 |
258 | ### Off We Go!
259 | 有些优化手段可能超出了你工作的范围,预算或是你负责的被遗弃的遗留代码范畴。没关系!把这份清单作为一般(希望是全面的)的指南,根据你实际的情况,列出你自己的问题列表。但是最最重要的是,在优化之前测试和监控你的项目,发现性能问题所在。最后希望大家,2017年有一个快乐的性能体验!
260 |
--------------------------------------------------------------------------------
/blog/Task, mictask, queues and schedules(翻译).md:
--------------------------------------------------------------------------------
1 | ## Task, mictask, queues and schedules(翻译)
2 | 作者: jake
3 | 原文链接: https://jakearchibald.com/2015/tasks-microtasks-queues-and-schedules/
4 | 翻译: Mrwaite
5 |
6 | 当我告诉我同事 [Matt Gaunt](https://twitter.com/gauntface) ,我正在考虑写一篇关于 microtask queueing和浏览器 event loop 的执行, 他说他不会去读这篇文章...但,我还是会写,希望大家有所收获!
7 |
8 | 事实上,你首先可以了解 [Philip Roberts](https://twitter.com/philip_roberts) 在 [JSConf 上关于 event loop的演讲](https://www.youtube.com/watch?v=8aGhZQkoFbQ) - microtasks 并没有涉及, 除此之外它仍是非常好的介绍.
9 |
10 | 先看下面这段 JavaScript :
11 | ```javascript
12 | console.log('script start');
13 |
14 | setTimeout(function() {
15 | console.log('setTimeout');
16 | }, 0);
17 |
18 | Promise.resolve().then(function() {
19 | console.log('promise1');
20 | }).then(function() {
21 | console.log('promise2');
22 | });
23 |
24 | console.log('script end');
25 | ```
26 |
27 | 正确的结果是:`script start`, `script end`, `promise1`, `promise2`, `setTimeout`, 但浏览器支持不同还是会有所不同的!
28 |
29 | Microsoft Edge, Firefox 40, iOS Safari 和 desktop Safari8.0.8会在 `promise1` 和 `promise2` 之前打印 `setTimeout`. 怪异的是, Firefox 39 和 Safari 8.0.7 却始终保持正确.
30 |
31 | #### 解释
32 |
33 | 为了理解, 首先你需要知道 event loop 是怎么处理 tasks 和 microtasks.这样当你接触这方面问题的时候,脑子里将会有很多思路.深呼吸...
34 |
35 |
36 | 每个'线程'都会有自己的 event loop ,所以每个 web worker 都会得到自己的, 所以它们可以独立执行, 而所有同源的窗口共享一个 event loop他们可以同步通讯. event loop不断执行任何已排队的 tasks.一个 event loop 有很多的 task 源,并确保该源的执行顺序(例如 indexedDB), 但是浏览器可以在每一轮的循环中挑选哪个源任务去执行.这样允许浏览器优先去执行性能敏感的任务,像是用户输入.ok, stay with me...
37 |
38 | Tasks需要被计划好, 这样浏览器深入到 JavaScript/DOM land, 确保这些 tasks 依次执行.两个 task 之间, 浏览器也许会渲染更新.从鼠标点击到事件回调需要安排一个 task ,解析HTML也是如此,在上面的例子中, `setTimeout`.
39 |
40 | `setTimeout`等待一个给定的延迟时间, 然后为它的回调安排一个新的 task .这就是为什么`setTimeout`在`script end`之前打印, 打印`script end`是第一个 task 的一部分, `setTimeout` 是在另一个 task 中打印的.好, 我们大都能理解这个, 但是我需要你坚持看下去...
41 |
42 | `Microtask` 通常是为那些在脚本执行完之后需要直接发生的任务而被安排的, 像是对一批任务做出反应, 或者在没有副作用的新 task 中做一些异步的事.只要没有其他 JavaScript 中间执行, 并且在每个任务结束之后, `Microtask` 队列将会在回调后执行.任何额外的 microtasks 将会被安排到队列的末尾, 依旧执行. `Microtask` 包括突发的观察者回调, 像上面的例子 promise 回调.
43 |
44 |
45 | 一旦 promise 状态保持不变, 它将会为其后面的回调函数在队列中加入一个 microtask. 这样就确保 promise 回调函数是异步的, 甚至 promise 已经变为 不可变状态(rejected or reslove, 就是即使临时加入一个promise回调也是会加入当前microtask的). 所以 `.tnen(yey, nay)`会立刻排入一个 microtask. 因为在 microtask 执行之前 当前的 running script(就是普通的执行脚本, 普通的script语句)必须执行完毕,所以 `promise1` 和 `promise2` 在 `script end` 之后打印.因为 microtask 总是在下一个 task 之前被执行, 所以 `promise1` 和 `promise2` 在 `setTimeout` 之前打印.
46 |
47 | (当前script就是第一个task, 然后执行第一个microtask也就是`promise1`和`promise2`, 之后执行下一个task也就是`setTimeout`)
48 |
49 | 再看看一步一步来是怎么回事:
50 | [原文有一个很好的一步一步查看task和microtask的示意图](https://jakearchibald.com/2015/tasks-microtasks-queues-and-schedules/#try-it/)
51 |
52 | 是的, 我搞了一个动画的分布示意图. 你是怎么度过你的周六的?和你的小伙伴出去溜溜?但是,我不是.若是因我惊人的UI设计中还是不明白, 点击上面的箭头一步一步前进.
53 |
54 | #### 浏览器的兼容性
55 |
56 | 有些浏览器打印出来的结果是 `script start`, `script end`, `setTimeout`, `promise1`, `promise2`. 他们是在 `setTimeout`之后执行 promise 的.这就像是他们把 promise 回调当做是新的 task 的一部分,而不是作为一个 microtask.
57 |
58 | 这也是有点情有可原的, promises 是来自 ECMAScript 而不是 HTML的. ECMAScript有'jobs'这个概念, 和microtask有点类似,但是他们的关系是不明确的,就像[ES DISCUSS中争论的那样](https://esdiscuss.org/topic/the-initialization-steps-for-web-browsers#content-16), 然而普遍的共识是 promises 应该属于 microtask queue 中的一部分, 并有很好的解释.
59 |
60 | 把 promises 作为 tasks 对待会导致性能问题, 回调将会因为像渲染这样的任务相关的东西导致不必要的延迟执行.它还会因为其他任务源的影响而导致不确定性.
61 |
62 | 这里有个[Promise callbacks don't run as microtasksEdge](https://connect.microsoft.com/IE/feedback/details/1658365) 的 Edge 反馈, WebKit 连夜修正了, 所以我保证 Safari 最终也会修正, 它可能会在 FireFox 46 修复.
63 |
64 | 非常有意思的是, 自从被修复, Safari 和 FireFox 都遭遇了一次回退, 我想这应该是一个巧合.
65 |
66 | #### 怎么去判断使用是 tasks 还是 microtask
67 | 测试是一个方法, 看log何时打印出来.
68 |
69 | 正确的方式是查看规范, 例如, [setTimeout 的第14步](https://html.spec.whatwg.org/multipage/webappapis.html#timer-initialisation-steps)中有关于如何对一个 task 进行排列, 而 [queuing a mutation record 的 第5步](https://dom.spec.whatwg.org/#queue-a-mutation-record) 是如何对 microtask 进行排列.
70 |
71 | 顺便提到, 在 ECMAScript 中, 他们称 microtask 为 'jobs'. 在 [ step 8.a of PerformPromiseThen](http://www.ecma-international.org/ecma-262/6.0/#sec-performpromisethen), `EnqueueJob` 被称为 `排列 microtask`.
72 |
73 | 现在, 让我看看更多的复杂的例子.
74 |
75 | #### Level 1 Boss战
76 | 在写这篇文章之前, 我已经犯过错了. 这里是一段 html:
77 | ```
78 |
81 | ```
82 |
83 | 给它加上下面的 JS, 如果我点击 `div.inner` 会打印什么?
84 | ```javascript
85 | // Let's get hold of those elements
86 | var outer = document.querySelector('.outer');
87 | var inner = document.querySelector('.inner');
88 |
89 | // Let's listen for attribute changes on the
90 | // outer element
91 | new MutationObserver(function() {
92 | console.log('mutate');
93 | }).observe(outer, {
94 | attributes: true
95 | });
96 |
97 | // Here's a click listener…
98 | function onClick() {
99 | console.log('click');
100 |
101 | setTimeout(function() {
102 | console.log('timeout');
103 | }, 0);
104 |
105 | Promise.resolve().then(function() {
106 | console.log('promise');
107 | });
108 |
109 | outer.setAttribute('data-random', Math.random());
110 | }
111 |
112 | // …which we'll attach to both elements
113 | inner.addEventListener('click', onClick);
114 | outer.addEventListener('click', onClick);
115 | ```
116 |
117 | 在偷看答案之前自己运行一遍, 提示: 不止打印一次.
118 |
119 | #### 验证
120 |
121 | 点击里面的块, 触发点击事件:
122 | [原文章有一个可操作的小demo](https://jakearchibald.com/2015/tasks-microtasks-queues-and-schedules/)
123 |
124 | 和你猜的一样吗? 如果是, 你或许是正确的. 不幸的是, 不同浏览器会不太一致:
125 | ```
126 | Chrome: click |promise | mutate | click | promise | mutate | timeout | timeout
127 |
128 | FireFox: click | mutate | click | mutate | timeout | promise | promise | timeout
129 |
130 | Safari: | click | mutate | clic | mutate| promise | promise | timeout| timeout
131 |
132 | IE:|click|click|mutate|timeout|promise|timeout|promise
133 | ```
134 |
135 | #### 谁是正确的?
136 |
137 | 调度 'click' 事件的是一个 task. ` Mutation observer ` 和 `promise callbacks ` 是属于 microtask的. `setTimeout` 回调是作为一个task的.所以这里就是它们是如何运行的:
138 |
139 | [查看原文章demo](https://jakearchibald.com/2015/tasks-microtasks-queues-and-schedules/)
140 |
141 | 如果是 Chrome , 它将会这样运行.其中对我来说新奇的是 microtask 是在 callbacks 之后处理的(只要没有其他的 JavaScript 中间执行).我认为它会被 `end-of-task` 限制.这个规则是来自 HTML 中的调用回调的规范:
142 |
143 | > 如果[脚本设置的对象栈](https://html.spec.whatwg.org/multipage/webappapis.html#stack-of-script-settings-objects)是空的, 就[执行一次 microtask 检查](https://html.spec.whatwg.org/multipage/webappapis.html#perform-a-microtask-checkpoint)
144 | > -- [HTML: 回调之后的清理 步骤3](https://html.spec.whatwg.org/multipage/webappapis.html#clean-up-after-running-a-callback)
145 |
146 | microtask 检查点将会遍及整个 microtask 队列, 直到处理了整个 microtask 队列. 相似的是, ECMAScript 是这么描述 `jobs` 的:
147 |
148 | > 只有在 没有正在运行的上下文 和 执行上下文栈是空的 这样的情况下, 才回去执行 `job`.
149 | > -- [ECMAScript: Job and Job queues](http://www.ecma-international.org/ecma-262/6.0/#sec-jobs-and-job-queues)
150 |
151 | 虽然在 HTML 上下文中 `can be` 会变成 `must be`~~~
152 |
153 | #### 浏览器出错了?
154 |
155 | `FireFox` 和 `Safari` 是在 click 监听者之间耗尽了 microtask 队列, 就像 mutation 回调所示, 但是 promises 似乎不太一样. 情有可原的是关联 `jobs` 和 `microtasks`是模糊的, 但我还是希望它们在监听者回调中调用.[Firefox ticket](https://bugzilla.mozilla.org/show_bug.cgi?id=1193394). [Safari ticket](https://bugs.webkit.org/show_bug.cgi?id=147933).
156 |
157 | 至于 Edge 我们已经看到排列 promise 是正确的,但是它在click 监听者之间处理 microtask 还是失败的, 取而代之的是会在所有监听者之后处理.这就能解释 `mutate` 会在所有 `click` 之后打印.[Bug ticket](https://connect.microsoft.com/IE/feedbackdetail/view/1658386/microtasks-queues-should-be-processed-following-event-listeners)
158 |
159 | #### Level 1 boss暴躁的老大哥
160 | 使用上面例子, 如果我们执行 `inner.click()` 会怎么样?
161 |
162 | 它将会像前面一样开始时间调度, 但是使用的是 script 而不是 真正的交互.
163 |
164 | #### try it
165 | [原文demo](https://jakearchibald.com/2015/tasks-microtasks-queues-and-schedules/)
166 |
167 | 浏览器的执行结果是:
168 | ```
169 | chrome: click | click | promise | mutate | promise | timeout | timeout
170 | FireFox: click | click | mutate | timeout | promise | promise | timeout
171 | Safari: click | click | mutate | promise | promise | timeout | timeout
172 | IE: click | click | mutate | timeout | promise | timeout | promise
173 | ```
174 |
175 | 我发誓在 chrome 上还是会显示不同的结果, 如果你在chrome中得到不同的结果, 欢迎在评论中告诉我其版本号.
176 |
177 | #### 为什么会不同
178 | 这就是它如何执行的:
179 | ```javascript
180 | // Let's get hold of those elements
181 | var outer = document.querySelector('.outer');
182 | var inner = document.querySelector('.inner');
183 |
184 | // Let's listen for attribute changes on the
185 | // outer element
186 | new MutationObserver(function() {
187 | console.log('mutate');
188 | }).observe(outer, {
189 | attributes: true
190 | });
191 | ```
192 |
193 | [原文demo](https://jakearchibald.com/2015/tasks-microtasks-queues-and-schedules/)
194 |
195 | 所以正确的是: click, click, promise, mutate, promise, timeout, timeout, chrome 上好像是正确的.
196 |
197 | 当所有的 监听者 回调都被调用之后...
198 | > 如果[脚本设置的对象栈](https://html.spec.whatwg.org/multipage/webappapis.html#stack-of-script-settings-objects)是空的, 就[执行一次 microtask 检查](https://html.spec.whatwg.org/multipage/webappapis.html#perform-a-microtask-checkpoint)
199 | > -- [HTML: 回调之后的清理 步骤3](https://html.spec.whatwg.org/multipage/webappapis.html#clean-up-after-running-a-callback)
200 |
201 | 原先, 这表明 microtask 是在 监听者回调之间 运行的, 但是 `.click()`导致事件同步调用, 所以在回调中 调用`.click()的script`依旧在栈中的. 以上的规则确保 microtask 不会中断 中间执行的 JavaScript.这意味着我们在监听者回调中是不会处理 microtask 的, 他们会在所有的监听者时候被处理.
202 |
203 | #### 这有什么关系吗?
204 |
205 | 好吧, 这还是讲的比较晦涩.我在尝试为 [`indexedDB` 创建一个简单的包装库过程中](https://github.com/jakearchibald/indexeddb-promised/blob/master/lib/idb.js), 使用了 promise 而不是 `IDBRequest` 对象, 遇到了这个问题.这使IDB很有趣的被使用.
206 |
207 | 当 IDB 触发了一个成功的事件, [涉及到交易的对象在调度完之后就变成停滞状态](http://w3c.github.io/IndexedDB/#fire-a-success-event)(步骤4),如果我创建一个 promise 会在 当事件 fire 时变为 resolve 状态, 当交易还是活跃的时候该回调应该在步骤4之前运行, 但是除了chrome在其他浏览器上预期的并未发生.
208 |
209 | 你可以在FireFox上试试触发这个问题, 因为像 [es6-promise](https://github.com/jakearchibald/es6-promise) 使用 `mutation observer` 作为回调, es6 polyfills使用的是 microtask. Safari好像因为其 fix 也会有些问题, 这就是他们的 [ broken implementation of IDB](http://www.raymondcamden.com/2014/09/25/IndexedDB-on-iOS-8-Broken-Bad),不幸的是, 在 IE/
210 | IE/Edge 上有些东西会反复的失败, 像是在回调之后 `mutation 事件` 并未被执行.
211 |
212 | 但愿我们将会在不久之后见到他们之间的一些互通性.
213 |
214 | #### 你做到了!
215 |
216 | 总结:
217 | + Task会顺序执行, 浏览器可能会在他们之间 发生渲染.
218 | + Microtask也是顺序执行, 他们会在下面两种情况下被执行:
219 | + 在每一个回调之后, 只要没有其他的中间执行的javascript
220 | + 在每一个 task 结束之后
221 | 但愿你现在可以理解事件循环.
222 |
223 | 所以, 现在有人还在看吗?hello?hello>
224 |
225 |
226 | #### 其他参考
227 |
228 | [JS基础 Promise](https://github.com/BlackGanglion/My-Reading-List/issues/4)
229 | [Difference between microtask and macrotask within an event loop context](https://stackoverflow.com/questions/25915634/difference-between-microtask-and-macrotask-within-an-event-loop-context)
230 | [非同步程式碼之霧:Node.js 的事件迴圈與 EventEmitter](https://medium.com/sivann-com-tw/%E9%9D%9E%E5%90%8C%E6%AD%A5%E7%A8%8B%E5%BC%8F%E7%A2%BC%E4%B9%8B%E9%9C%A7-node-js-%E7%9A%84%E4%BA%8B%E4%BB%B6%E8%BF%B4%E5%9C%88%E8%88%87-eventemitter-809432976c1b)
231 | [javascript线程解释(setTimeout,setInterval你不知道的事)](http://www.cnblogs.com/youxin/p/3354924.html)
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
--------------------------------------------------------------------------------
/blog/对区块链的一些思考.md:
--------------------------------------------------------------------------------
1 | ## 对区块链的一些思考
2 |
3 | 参考链接:
4 | [区块链技术指南](https://yeasy.gitbooks.io/blockchain_guide/content/)
5 | [TED最火演讲: 区块链将如何改变世界](https://mp.weixin.qq.com/s/pMQ4G5DbWwBmFuvVAhRN2g)
6 | [Page seven胡先笙](https://music.163.com/#/djradio?id=4387004)
7 | [PluralSight](https://app.pluralsight.com/library/courses/bitcoin-decentralized-technology)
8 | [比特币白皮书](https://bitcoin.org/bitcoin.pdf)
9 | [ Introduction to Bitcoin - Andreas Antonopoulus](https://www.youtube.com/channel/UCJWCJCWOxBYSi5DhCieLOLQ)
10 | [Mastering Bitcoin](https://github.com/bitcoinbook/bitcoinbook)
11 | [Revealing Ethereum at Bitcoin Miami 2014 - Vitalik](https://www.youtube.com/watch?v=l9dpjN3Mwps)
12 |
--------------------------------------------------------------------------------
/frontend-compare-score-2016.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mrwaite/Share/e0cbf85a1790eb396f09cc735c262c22037303e9/frontend-compare-score-2016.jpg
--------------------------------------------------------------------------------
/gulpfile.js:
--------------------------------------------------------------------------------
1 | var gulp = require('gulp'),
2 | sass = require('gulp-ruby-sass'),
3 | autoprefixer = require('gulp-autoprefixer'),
4 | minifycss = require('gulp-minify-css'),
5 | jshint = require('gulp-jshint'),
6 | uglify = require('gulp-uglify'),
7 | imagemin = require('gulp-imagemin'),
8 | rename = require('gulp-rename'),
9 | concat = require('gulp-concat'),
10 | notify = require('gulp-notify'),
11 | cache = require('gulp-cache'),
12 | livereload = require('gulp-livereload'),
13 | del = require('del');
14 |
15 | gulp.task('styles' , function () {
16 | return sass('src/styles/main.scss', { style : 'expanded' })
17 | .pipe(autoprefixer('last 2 version', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1', 'andriod 4'))
18 | .pipe(gulp.dest('dist/assets/css'))
19 | .pipe(rename({suffix : '.min'}))
20 | .pipe(minifycss())
21 | .pipe(gulp.dest('dist/assets/css'))
22 | .pipe(notify({ message : 'Style Task Complete'}));
23 | });
24 |
25 | gulp.task('scripts', function () {
26 | return gulp.src('src/scripts/**/*.js')
27 | .pipe(jshint('.jshintrc'))
28 | .pipe(jshint.reporter('default'))
29 | .pipe(concat('main.js'))
30 | .pipe(gulp.dest('dist/assets/js'))
31 | .pipe(rename({ suffix : '.min' }))
32 | .pipe(uglify())
33 | .pipe(gulp.dest('dist/assets/js'))
34 | .pipe(notify({ message : 'scripts task complete' }));
35 | });
36 | gulp.task('images', function () {
37 | return gulp.src('src/images/**/*')
38 | .pipe(cache(imagemin({ optimizationLevel : 5, progressive : true, interlaced : true})))
39 | .pipe(gulp.dest('dist/assets/img'))
40 | .pipe(notify({ message : 'Image task complete' }));
41 | });
42 |
43 | gulp.task('clean', function (cb) {
44 | del(['dist/assets/css', 'dist/assets/js', 'dist/assets/img'], cb);
45 | });
46 |
47 | gulp.task('default', ['clean','styles', 'scripts', 'images']);
48 |
49 | gulp.task('watch', function () {
50 | //watch scss files
51 | //gulp.watch('src/styles/**/*.scss', ['styles']);
52 |
53 | //watch .js files
54 | //gulp.watch('src/scripts/**/*.js', ['scripts']);
55 |
56 | //watch image files
57 | //gulp.watch('src/image/**/*', ['images']);
58 |
59 | //create livereload server
60 | livereload.listen();
61 |
62 | //watch any files in dist/, reload on change
63 | gulp.watch(['dist/**']).on('change', livereload.changed());
64 | });
65 |
66 |
67 |
68 |
69 |
70 |
--------------------------------------------------------------------------------
/log.txt:
--------------------------------------------------------------------------------
1 | INFO: loading config from /home/mrwaite/shadowsocks.json
2 | 2017-03-09 08:00:52 INFO starting local at 127.0.0.1:1080
3 | 2017-03-09 08:01:01 INFO connecting clients4.google.com:443
4 | 2017-03-09 08:01:01 INFO connecting clients4.google.com:443
5 | 2017-03-09 08:01:05 INFO connecting www.googleapis.com:443
6 | 2017-03-09 08:01:05 INFO connecting www.googleapis.com:443
7 | 2017-03-09 10:39:58 INFO connecting marketplace.visualstudio.com:443
8 | 2017-03-09 10:40:00 INFO connecting marketplace.visualstudio.com:443
9 | 2017-03-09 10:40:00 INFO connecting marketplace.visualstudio.com:443
10 | 2017-03-09 10:40:00 INFO connecting marketplace.visualstudio.com:443
11 | 2017-03-09 10:40:02 INFO connecting api.digitalparticle.com:80
12 | 2017-03-09 10:40:19 INFO connecting marketplace.visualstudio.com:443
13 | 2017-03-09 10:40:20 INFO connecting vscode-update.azurewebsites.net:443
14 | 2017-03-09 10:40:20 INFO connecting api.digitalparticle.com:80
15 | 2017-03-09 10:40:20 INFO connecting marketplace.visualstudio.com:443
16 | 2017-03-09 10:40:20 INFO connecting marketplace.visualstudio.com:443
17 | 2017-03-09 10:40:20 INFO connecting marketplace.visualstudio.com:443
18 | 2017-03-09 16:52:38 ERROR poll:[Errno 4] Interrupted system call
19 | Traceback (most recent call last):
20 | File "/usr/lib/python2.7/dist-packages/shadowsocks/eventloop.py", line 198, in run
21 | events = self.poll(1)
22 | File "/usr/lib/python2.7/dist-packages/shadowsocks/eventloop.py", line 175, in poll
23 | events = self._impl.poll(timeout)
24 | File "/usr/lib/python2.7/dist-packages/shadowsocks/eventloop.py", line 63, in poll
25 | return self._epoll.poll(timeout)
26 | IOError: [Errno 4] Interrupted system call
27 | 2017-03-09 19:12:03 ERROR poll:[Errno 4] Interrupted system call
28 | Traceback (most recent call last):
29 | File "/usr/lib/python2.7/dist-packages/shadowsocks/eventloop.py", line 198, in run
30 | events = self.poll(1)
31 | File "/usr/lib/python2.7/dist-packages/shadowsocks/eventloop.py", line 175, in poll
32 | events = self._impl.poll(timeout)
33 | File "/usr/lib/python2.7/dist-packages/shadowsocks/eventloop.py", line 63, in poll
34 | return self._epoll.poll(timeout)
35 | IOError: [Errno 4] Interrupted system call
36 | 2017-03-09 19:27:07 INFO connecting clients1.google.com:443
37 | 2017-03-09 19:27:07 INFO connecting clients1.google.com:443
38 | 2017-03-09 19:27:11 INFO connecting raw.githubusercontent.com:443
39 | 2017-03-09 19:27:11 INFO connecting pbs.twimg.com:443
40 | 2017-03-09 19:27:11 INFO connecting pbs.twimg.com:443
41 | 2017-03-09 19:27:11 INFO connecting pbs.twimg.com:443
42 | 2017-03-09 19:27:14 INFO connecting www.google.com.hk:443
43 | 2017-03-09 19:27:14 INFO connecting www.google.com.hk:443
44 | 2017-03-09 19:27:14 INFO connecting www.google.com.hk:443
45 | 2017-03-09 19:27:14 INFO connecting www.google.com.hk:443
46 | 2017-03-09 19:27:15 INFO connecting www.google.com.hk:443
47 | 2017-03-09 19:27:16 INFO connecting www.google.com:443
48 | 2017-03-09 19:27:18 ERROR [Errno 104] Connection reset by peer
49 | 2017-03-09 19:27:18 INFO connecting lh3.googleusercontent.com:443
50 | 2017-03-09 19:27:19 INFO connecting www.gstatic.com:443
51 | 2017-03-09 19:27:20 INFO connecting clients5.google.com:443
52 | 2017-03-09 19:27:20 INFO connecting apis.google.com:443
53 | 2017-03-09 19:27:20 INFO connecting ogs.google.com:443
54 | 2017-03-09 19:27:25 ERROR [Errno 104] Connection reset by peer
55 | 2017-03-09 19:27:25 ERROR [Errno 104] Connection reset by peer
56 | 2017-03-09 19:27:25 INFO connecting notifications.google.com:443
57 | 2017-03-09 19:27:26 ERROR [Errno 104] Connection reset by peer
58 | 2017-03-09 19:27:26 ERROR [Errno 104] Connection reset by peer
59 | 2017-03-09 19:27:26 ERROR [Errno 104] Connection reset by peer
60 | 2017-03-09 19:27:26 ERROR [Errno 104] Connection reset by peer
61 | 2017-03-09 19:27:26 INFO connecting fonts.gstatic.com:443
62 | 2017-03-09 19:27:27 INFO connecting beacons3.gvt2.com:443
63 | 2017-03-09 19:27:27 INFO connecting beacons3.gvt2.com:443
64 | 2017-03-09 19:27:27 INFO connecting beacons3.gvt2.com:443
65 | 2017-03-09 19:27:27 INFO connecting xn--vue-wu9dj99s7gqg8g:80
66 | 2017-03-09 19:27:29 INFO connecting id.google.com.hk:443
67 | 2017-03-09 19:27:29 INFO connecting twitter.com:443
68 | 2017-03-09 19:27:39 ERROR [Errno 104] Connection reset by peer
69 | 2017-03-09 19:27:39 ERROR [Errno 104] Connection reset by peer
70 | 2017-03-09 19:27:39 INFO connecting beacons5.gvt2.com:443
71 | 2017-03-09 19:27:39 INFO connecting pbs.twimg.com:443
72 | 2017-03-09 19:27:39 INFO connecting pbs.twimg.com:443
73 | 2017-03-09 19:27:39 INFO connecting pbs.twimg.com:443
74 | 2017-03-09 19:27:39 INFO connecting ssl.gstatic.com:443
75 | 2017-03-09 19:27:41 INFO connecting github.com:443
76 | 2017-03-09 19:27:42 INFO connecting avatars1.githubusercontent.com:443
77 | 2017-03-09 19:27:43 INFO connecting avatars1.githubusercontent.com:443
78 | 2017-03-09 19:27:43 INFO connecting avatars2.githubusercontent.com:443
79 | 2017-03-09 19:27:43 INFO connecting avatars2.githubusercontent.com:443
80 | 2017-03-09 19:27:43 INFO connecting camo.githubusercontent.com:443
81 | 2017-03-09 19:27:43 INFO connecting camo.githubusercontent.com:443
82 | 2017-03-09 19:27:43 INFO connecting camo.githubusercontent.com:443
83 | 2017-03-09 19:27:43 INFO connecting camo.githubusercontent.com:443
84 | 2017-03-09 19:27:43 INFO connecting avatars1.githubusercontent.com:443
85 | 2017-03-09 19:27:43 INFO connecting avatars3.githubusercontent.com:443
86 | 2017-03-09 19:27:43 INFO connecting avatars3.githubusercontent.com:443
87 | 2017-03-09 19:27:44 INFO connecting github.algolia.com:443
88 | 2017-03-09 19:27:45 INFO connecting www.imooc.com:80
89 | 2017-03-09 19:27:45 INFO connecting collector.githubapp.com:443
90 | 2017-03-09 19:27:45 INFO connecting assets-cdn.github.com:443
91 | 2017-03-09 19:27:45 INFO connecting live.github.com:443
92 | 2017-03-09 19:27:45 INFO connecting api.github.com:443
93 | 2017-03-09 19:27:47 INFO connecting static.mukewang.com:80
94 | 2017-03-09 19:27:48 INFO connecting api.github.com:443
95 | 2017-03-09 19:27:48 INFO connecting www.imooc.com:80
96 | 2017-03-09 19:27:48 INFO connecting www.imooc.com:80
97 | 2017-03-09 19:27:48 INFO connecting www.imooc.com:80
98 | 2017-03-09 19:27:48 INFO connecting img.mukewang.com:80
99 | 2017-03-09 19:27:48 INFO connecting img.mukewang.com:80
100 | 2017-03-09 19:27:48 INFO connecting static.mukewang.com:80
101 | 2017-03-09 19:27:49 INFO connecting api.github.com:443
102 | 2017-03-09 19:27:49 INFO connecting api.github.com:443
103 | 2017-03-09 19:27:52 INFO connecting static.mukewang.com:80
104 | 2017-03-09 19:27:52 INFO connecting static.mukewang.com:80
105 | 2017-03-09 19:27:52 INFO connecting static.mukewang.com:80
106 | 2017-03-09 19:27:52 INFO connecting static.mukewang.com:80
107 | 2017-03-09 19:27:52 INFO connecting static.mukewang.com:80
108 | 2017-03-09 19:27:53 ERROR [Errno 104] Connection reset by peer
109 | 2017-03-09 19:27:53 ERROR [Errno 104] Connection reset by peer
110 | 2017-03-09 19:27:53 ERROR [Errno 104] Connection reset by peer
111 | 2017-03-09 19:27:53 ERROR [Errno 104] Connection reset by peer
112 | 2017-03-09 19:27:53 INFO connecting www.inoreader.com:443
113 | 2017-03-09 19:27:55 INFO connecting beacons.gvt2.com:443
114 | 2017-03-09 19:28:09 INFO connecting app.yinxiang.com:443
115 | 2017-03-09 19:28:14 INFO connecting mtalk.google.com:5228
116 | 2017-03-09 19:28:18 INFO connecting www.google.com.hk:443
117 | 2017-03-09 19:28:30 INFO connecting google.com:443
118 | 2017-03-09 19:29:12 INFO connecting beacons4.gvt2.com:443
119 | 2017-03-09 19:29:32 INFO connecting clients4.google.com:443
120 | 2017-03-09 19:29:53 INFO connecting www.imooc.com:80
121 | 2017-03-09 19:29:56 INFO connecting www.imooc.com:80
122 | 2017-03-09 19:29:56 INFO connecting www.imooc.com:80
123 | 2017-03-09 19:29:56 INFO connecting www.imooc.com:80
124 | 2017-03-09 19:29:56 INFO connecting www.imooc.com:80
125 | 2017-03-09 19:29:56 INFO connecting www.imooc.com:80
126 | 2017-03-09 19:30:00 INFO connecting img.mukewang.com:80
127 | 2017-03-09 19:30:00 INFO connecting img.mukewang.com:80
128 | 2017-03-09 19:30:00 INFO connecting img.mukewang.com:80
129 | 2017-03-09 19:30:00 INFO connecting img.mukewang.com:80
130 | 2017-03-09 19:30:00 INFO connecting img.mukewang.com:80
131 | 2017-03-09 19:30:00 INFO connecting img.mukewang.com:80
132 | 2017-03-09 19:30:19 INFO connecting mtalk.google.com:5228
133 | 2017-03-09 19:30:55 INFO connecting maxiang.io:443
134 | 2017-03-09 19:31:38 INFO connecting 113.142.84.117:80
135 | 2017-03-09 19:32:24 INFO connecting mtalk.google.com:5228
136 | 2017-03-09 19:32:24 INFO connecting maxiang.io:443
137 | 2017-03-09 19:32:44 INFO connecting github.com:443
138 | 2017-03-09 19:32:53 INFO connecting www.inoreader.com:443
139 | 2017-03-09 19:33:39 INFO connecting www.google.com.hk:443
140 | 2017-03-09 19:33:47 INFO connecting clients4.google.com:443
141 | 2017-03-09 19:34:29 INFO connecting mtalk.google.com:5228
142 | 2017-03-09 19:34:50 ERROR [Errno 104] Connection reset by peer
143 | 2017-03-09 19:34:50 INFO connecting www.google.com.hk:443
144 | 2017-03-09 19:34:54 INFO connecting maxiang.io:443
145 | 2017-03-09 19:35:24 INFO connecting maxiang.io:443
146 | 2017-03-09 19:35:53 INFO connecting 113.142.84.113:80
147 | 2017-03-09 19:35:56 INFO connecting 222.24.19.190:8080
148 | 2017-03-09 19:36:35 INFO connecting mtalk.google.com:5228
149 | 2017-03-09 19:36:44 INFO connecting 222.24.19.190:8080
150 | 2017-03-09 19:37:17 INFO connecting translate.googleapis.com:443
151 | 2017-03-09 19:37:44 INFO connecting github.com:443
152 | 2017-03-09 19:37:53 INFO connecting www.inoreader.com:443
153 | 2017-03-09 19:38:17 INFO connecting clients4.google.com:443
154 | 2017-03-09 19:38:41 INFO connecting mtalk.google.com:5228
155 | 2017-03-09 19:39:13 INFO connecting www.google.com.hk:443
156 | 2017-03-09 19:39:27 INFO connecting clients4.google.com:443
157 | 2017-03-09 19:39:56 INFO connecting sub.adtchrome.com:80
158 | 2017-03-09 19:39:56 INFO connecting sub.adtchrome.com:80
159 | 2017-03-09 19:39:56 INFO connecting sub.adtchrome.com:80
160 | 2017-03-09 19:40:30 INFO connecting www.google.com.hk:443
161 | 2017-03-09 19:40:38 INFO connecting clients1.google.com:443
162 | 2017-03-09 19:40:46 INFO connecting mtalk.google.com:5228
163 | 2017-03-09 19:40:59 INFO connecting vuex.vuejs.org:443
164 | 2017-03-09 19:41:01 INFO connecting fonts.gstatic.com:443
165 | 2017-03-09 19:41:06 INFO connecting maxiang.io:443
166 | 2017-03-09 19:42:44 ERROR [Errno 104] Connection reset by peer
167 | 2017-03-09 19:42:44 INFO connecting github.com:443
168 | 2017-03-09 19:42:51 INFO connecting mtalk.google.com:5228
169 | 2017-03-09 19:42:53 INFO connecting www.inoreader.com:443
170 | 2017-03-09 19:43:11 INFO connecting app.yinxiang.com:443
171 | 2017-03-09 19:44:29 INFO connecting api.xitu.io:80
172 | 2017-03-09 19:44:29 INFO connecting api.xitu.io:80
173 | 2017-03-09 19:44:29 INFO connecting api.xitu.io:80
174 | 2017-03-09 19:44:29 INFO connecting images.unsplash.com:443
175 | 2017-03-09 19:44:29 INFO connecting images.unsplash.com:443
176 | 2017-03-09 19:44:29 INFO connecting images.unsplash.com:443
177 | 2017-03-09 19:44:29 INFO connecting images.unsplash.com:443
178 | 2017-03-09 19:44:29 INFO connecting images.unsplash.com:443
179 | 2017-03-09 19:44:29 INFO connecting images.unsplash.com:443
180 | 2017-03-09 19:44:30 INFO connecting www.google.com.hk:443
181 | 2017-03-09 19:44:32 INFO connecting 115.29.201.173:80
182 | 2017-03-09 19:44:32 INFO connecting 115.29.201.173:80
183 | 2017-03-09 19:44:32 INFO connecting 115.29.201.173:80
184 | 2017-03-09 19:44:56 INFO connecting 115.29.201.173:80
185 | 2017-03-09 19:44:56 INFO connecting 115.29.201.173:80
186 | 2017-03-09 19:44:56 INFO connecting mtalk.google.com:5228
187 | 2017-03-09 19:44:57 INFO connecting 115.29.201.173:80
188 | 2017-03-09 19:44:57 INFO connecting 115.29.201.173:80
189 | 2017-03-09 19:44:57 INFO connecting 115.29.201.173:80
190 | 2017-03-09 19:44:57 INFO connecting 115.29.201.173:80
191 | 2017-03-09 19:45:07 INFO connecting 115.29.201.173:80
192 | 2017-03-09 19:45:08 INFO connecting 115.29.201.173:80
193 | 2017-03-09 19:45:10 INFO connecting 115.29.201.173:80
194 | 2017-03-09 19:45:17 INFO connecting 115.29.201.173:80
195 | 2017-03-09 19:45:17 INFO connecting 115.29.201.173:80
196 | 2017-03-09 19:45:17 INFO connecting 115.29.201.173:80
197 | 2017-03-09 19:45:17 INFO connecting 115.29.201.173:80
198 | 2017-03-09 19:45:17 INFO connecting 115.29.201.173:80
199 | 2017-03-09 19:45:18 INFO connecting 115.29.201.173:80
200 | 2017-03-09 19:45:24 INFO connecting 115.29.201.173:80
201 | 2017-03-09 19:45:38 ERROR [Errno 104] Connection reset by peer
202 | 2017-03-09 19:45:38 ERROR [Errno 104] Connection reset by peer
203 | 2017-03-09 19:45:38 ERROR [Errno 104] Connection reset by peer
204 | 2017-03-09 19:45:38 ERROR [Errno 104] Connection reset by peer
205 | 2017-03-09 19:45:38 ERROR [Errno 104] Connection reset by peer
206 | 2017-03-09 19:45:38 ERROR [Errno 104] Connection reset by peer
207 | 2017-03-09 19:45:38 INFO connecting beacons.gvt2.com:443
208 | 2017-03-09 19:45:45 INFO connecting 115.29.201.173:80
209 | 2017-03-09 19:45:56 INFO connecting 222.24.19.190:8080
210 | 2017-03-09 19:46:37 INFO connecting api.xitu.io:80
211 | 2017-03-09 19:46:37 INFO connecting api.xitu.io:80
212 | 2017-03-09 19:46:37 INFO connecting api.xitu.io:80
213 | 2017-03-09 19:46:37 INFO connecting images.unsplash.com:443
214 | 2017-03-09 19:46:37 INFO connecting images.unsplash.com:443
215 | 2017-03-09 19:46:37 INFO connecting images.unsplash.com:443
216 | 2017-03-09 19:46:37 INFO connecting images.unsplash.com:443
217 | 2017-03-09 19:46:39 INFO connecting clients4.google.com:443
218 | 2017-03-09 19:47:02 INFO connecting mtalk.google.com:5228
219 | 2017-03-09 19:47:38 ERROR [Errno 104] Connection reset by peer
220 | 2017-03-09 19:47:38 ERROR [Errno 104] Connection reset by peer
221 | 2017-03-09 19:47:38 ERROR [Errno 104] Connection reset by peer
222 | 2017-03-09 19:47:38 ERROR [Errno 104] Connection reset by peer
223 | 2017-03-09 19:47:38 INFO connecting www.google.com.hk:443
224 | 2017-03-09 19:47:44 INFO connecting github.com:443
225 | 2017-03-09 19:47:53 INFO connecting www.inoreader.com:443
226 | 2017-03-09 19:48:03 INFO connecting 115.29.201.173:80
227 | 2017-03-09 19:48:03 INFO connecting 115.29.201.173:80
228 | 2017-03-09 19:48:03 INFO connecting 115.29.201.173:80
229 | 2017-03-09 19:48:03 INFO connecting 115.29.201.173:80
230 | 2017-03-09 19:48:03 INFO connecting 115.29.201.173:80
231 | 2017-03-09 19:48:59 INFO connecting mmbiz.qpic.cn:80
232 | 2017-03-09 19:48:59 INFO connecting mmbiz.qpic.cn:80
233 | 2017-03-09 19:48:59 INFO connecting mmbiz.qpic.cn:80
234 | 2017-03-09 19:48:59 INFO connecting mmbiz.qpic.cn:80
235 | 2017-03-09 19:49:07 INFO connecting mtalk.google.com:5228
236 | 2017-03-09 19:51:05 INFO connecting api.xitu.io:80
237 | 2017-03-09 19:51:05 INFO connecting api.xitu.io:80
238 | 2017-03-09 19:51:05 INFO connecting api.xitu.io:80
239 | 2017-03-09 19:51:06 INFO connecting www.google.com.hk:443
240 | 2017-03-09 19:51:06 INFO connecting pbs.twimg.com:443
241 | 2017-03-09 19:51:06 INFO connecting id.google.com.hk:443
242 | 2017-03-09 19:51:06 INFO connecting ssl.gstatic.com:443
243 | 2017-03-09 19:51:06 INFO connecting www.google.com:443
244 | 2017-03-09 19:51:06 INFO connecting pbs.twimg.com:443
245 | 2017-03-09 19:51:06 INFO connecting www.gstatic.com:443
246 | 2017-03-09 19:51:06 INFO connecting images.unsplash.com:443
247 | 2017-03-09 19:51:06 INFO connecting images.unsplash.com:443
248 | 2017-03-09 19:51:06 INFO connecting images.unsplash.com:443
249 | 2017-03-09 19:51:06 INFO connecting images.unsplash.com:443
250 | 2017-03-09 19:51:06 INFO connecting images.unsplash.com:443
251 | 2017-03-09 19:51:06 INFO connecting images.unsplash.com:443
252 | 2017-03-09 19:51:06 INFO connecting www.google.com.hk:443
253 | 2017-03-09 19:51:06 INFO connecting www.google.com.hk:443
254 | 2017-03-09 19:51:06 INFO connecting www.google.com.hk:443
255 | 2017-03-09 19:51:06 INFO connecting www.google.com.hk:443
256 | 2017-03-09 19:51:07 INFO connecting code.mrwaite.cn:80
257 | 2017-03-09 19:51:07 INFO connecting cdn.bootcss.com:80
258 | 2017-03-09 19:51:07 INFO connecting cdn.bootcss.com:80
259 | 2017-03-09 19:51:07 INFO connecting code.mrwaite.cn:80
260 | 2017-03-09 19:51:07 INFO connecting code.mrwaite.cn:80
261 | 2017-03-09 19:51:07 INFO connecting code.mrwaite.cn:80
262 | 2017-03-09 19:51:07 INFO connecting ojr16of5n.bkt.clouddn.com:80
263 | 2017-03-09 19:51:07 INFO connecting ojr16of5n.bkt.clouddn.com:80
264 | 2017-03-09 19:51:09 INFO connecting stats.g.doubleclick.net:443
265 | 2017-03-09 19:51:12 INFO connecting mtalk.google.com:5228
266 | 2017-03-09 19:51:19 ERROR [Errno 104] Connection reset by peer
267 | 2017-03-09 19:51:19 ERROR [Errno 104] Connection reset by peer
268 | 2017-03-09 19:51:19 ERROR [Errno 104] Connection reset by peer
269 | 2017-03-09 19:51:19 ERROR [Errno 104] Connection reset by peer
270 | 2017-03-09 19:51:19 ERROR [Errno 104] Connection reset by peer
271 | 2017-03-09 19:51:19 ERROR [Errno 104] Connection reset by peer
272 | 2017-03-09 19:51:19 ERROR [Errno 104] Connection reset by peer
273 | 2017-03-09 19:51:19 ERROR [Errno 104] Connection reset by peer
274 | 2017-03-09 19:51:19 ERROR [Errno 104] Connection reset by peer
275 | 2017-03-09 19:51:19 ERROR [Errno 104] Connection reset by peer
276 | 2017-03-09 19:51:19 ERROR [Errno 104] Connection reset by peer
277 | 2017-03-09 19:51:19 ERROR [Errno 104] Connection reset by peer
278 | 2017-03-09 19:51:19 ERROR [Errno 104] Connection reset by peer
279 | 2017-03-09 19:51:19 ERROR [Errno 104] Connection reset by peer
280 | 2017-03-09 19:51:19 ERROR [Errno 104] Connection reset by peer
281 | 2017-03-09 19:51:19 INFO connecting clients4.google.com:443
282 | 2017-03-09 19:51:23 INFO connecting clients1.google.com:443
283 | 2017-03-09 19:52:07 INFO connecting www.google.com.hk:443
284 | 2017-03-09 19:52:07 INFO connecting beacons.gvt2.com:443
285 | 2017-03-09 19:52:07 INFO connecting beacons5.gvt3.com:443
286 | 2017-03-09 19:52:44 INFO connecting github.com:443
287 | 2017-03-09 19:52:44 INFO connecting www.googleapis.com:443
288 | 2017-03-09 19:52:53 INFO connecting www.inoreader.com:443
289 | 2017-03-09 19:53:18 INFO connecting mtalk.google.com:5228
290 | 2017-03-09 19:55:23 INFO connecting mtalk.google.com:5228
291 | 2017-03-09 19:55:35 INFO connecting maxiang.io:443
292 | 2017-03-09 19:55:56 INFO connecting 222.24.19.190:8080
293 | 2017-03-09 19:57:28 INFO connecting mtalk.google.com:5228
294 | 2017-03-09 19:57:44 INFO connecting github.com:443
295 | 2017-03-09 19:57:53 INFO connecting www.inoreader.com:443
296 | 2017-03-09 19:58:13 INFO connecting app.yinxiang.com:443
297 | 2017-03-09 19:59:33 INFO connecting mtalk.google.com:5228
298 | 2017-03-09 20:00:01 INFO connecting 61.134.46.28:80
299 | 2017-03-09 20:00:04 INFO connecting clients4.google.com:443
300 | 2017-03-09 20:00:33 INFO connecting maxiang.io:443
301 | 2017-03-09 20:00:36 INFO connecting www.google.com.hk:443
302 | 2017-03-09 20:00:41 INFO connecting id.google.com.hk:443
303 | 2017-03-09 20:00:51 INFO connecting clients4.google.com:443
304 | 2017-03-09 20:00:55 INFO connecting gold.xitu.io:443
305 | 2017-03-09 20:00:55 INFO connecting gold.xitu.io:443
306 | 2017-03-09 20:00:58 INFO connecting app-router.leancloud.cn:443
307 | 2017-03-09 20:00:58 INFO connecting app-router.leancloud.cn:443
308 | 2017-03-09 20:00:58 INFO connecting app-router.leancloud.cn:443
309 | 2017-03-09 20:00:58 INFO connecting avatars.githubusercontent.com:443
310 | 2017-03-09 20:00:58 INFO connecting avatars.githubusercontent.com:443
311 | 2017-03-09 20:00:58 INFO connecting avatars.githubusercontent.com:443
312 | 2017-03-09 20:00:58 INFO connecting avatars.githubusercontent.com:443
313 | 2017-03-09 20:00:58 INFO connecting avatars.githubusercontent.com:443
314 | 2017-03-09 20:00:58 INFO connecting gold-cdn.xitu.io:443
315 | 2017-03-09 20:00:58 INFO connecting gold-cdn.xitu.io:443
316 | 2017-03-09 20:00:58 INFO connecting gold-cdn.xitu.io:443
317 | 2017-03-09 20:00:58 INFO connecting gold-cdn.xitu.io:443
318 | 2017-03-09 20:00:58 INFO connecting gold-cdn.xitu.io:443
319 | 2017-03-09 20:00:58 INFO connecting gold-cdn.xitu.io:443
320 | 2017-03-09 20:00:58 INFO connecting pbs.twimg.com:443
321 | 2017-03-09 20:00:58 INFO connecting pbs.twimg.com:443
322 | 2017-03-09 20:00:58 INFO connecting pbs.twimg.com:443
323 | 2017-03-09 20:00:58 INFO connecting user-gold-cdn.xitu.io:443
324 | 2017-03-09 20:00:58 INFO connecting user-gold-cdn.xitu.io:443
325 | 2017-03-09 20:00:58 INFO connecting user-gold-cdn.xitu.io:443
326 | 2017-03-09 20:00:58 INFO connecting user-gold-cdn.xitu.io:443
327 | 2017-03-09 20:00:58 INFO connecting user-gold-cdn.xitu.io:443
328 | 2017-03-09 20:00:58 INFO connecting juejin.im:443
329 | 2017-03-09 20:01:08 INFO connecting user-notification-api-ms.juejin.im:443
330 | 2017-03-09 20:01:08 INFO connecting my-wallet-api-ms.juejin.im:443
331 | 2017-03-09 20:01:08 ERROR [Errno 104] Connection reset by peer
332 | 2017-03-09 20:01:08 ERROR [Errno 104] Connection reset by peer
333 | 2017-03-09 20:01:08 ERROR [Errno 104] Connection reset by peer
334 | 2017-03-09 20:01:08 ERROR [Errno 104] Connection reset by peer
335 | 2017-03-09 20:01:08 ERROR [Errno 104] Connection reset by peer
336 | 2017-03-09 20:01:08 ERROR [Errno 104] Connection reset by peer
337 | 2017-03-09 20:01:08 ERROR [Errno 104] Connection reset by peer
338 | 2017-03-09 20:01:08 INFO connecting app-router.leancloud.cn:443
339 | 2017-03-09 20:01:09 ERROR [Errno 104] Connection reset by peer
340 | 2017-03-09 20:01:09 INFO connecting ubc-api-ms.juejin.im:443
341 | 2017-03-09 20:01:10 INFO connecting stats.g.doubleclick.net:443
342 | 2017-03-09 20:01:11 INFO connecting api.leancloud.cn:443
343 | 2017-03-09 20:01:11 INFO connecting api.leancloud.cn:443
344 | 2017-03-09 20:01:11 INFO connecting api.leancloud.cn:443
345 | 2017-03-09 20:01:11 INFO connecting app-router.leancloud.cn:443
346 | 2017-03-09 20:01:11 INFO connecting avatars.githubusercontent.com:443
347 | 2017-03-09 20:01:11 INFO connecting avatars.githubusercontent.com:443
348 | 2017-03-09 20:01:11 INFO connecting avatars.githubusercontent.com:443
349 | 2017-03-09 20:01:11 INFO connecting avatars.githubusercontent.com:443
350 | 2017-03-09 20:01:11 INFO connecting pbs.twimg.com:443
351 | 2017-03-09 20:01:11 INFO connecting pbs.twimg.com:443
352 | 2017-03-09 20:01:11 INFO connecting user-gold-cdn.xitu.io:443
353 | 2017-03-09 20:01:13 INFO connecting api.leancloud.cn:443
354 | 2017-03-09 20:01:13 INFO connecting api.leancloud.cn:443
355 | 2017-03-09 20:01:14 INFO connecting api.leancloud.cn:443
356 | 2017-03-09 20:01:15 INFO connecting api.leancloud.cn:443
357 | 2017-03-09 20:01:16 INFO connecting api.leancloud.cn:443
358 | 2017-03-09 20:01:22 ERROR [Errno 104] Connection reset by peer
359 | 2017-03-09 20:01:22 ERROR [Errno 104] Connection reset by peer
360 | 2017-03-09 20:01:22 ERROR [Errno 104] Connection reset by peer
361 | 2017-03-09 20:01:22 ERROR [Errno 104] Connection reset by peer
362 | 2017-03-09 20:01:22 ERROR [Errno 104] Connection reset by peer
363 | 2017-03-09 20:01:22 ERROR [Errno 104] Connection reset by peer
364 | 2017-03-09 20:01:22 INFO connecting api.leancloud.cn:443
365 | 2017-03-09 20:01:22 INFO connecting api.leancloud.cn:443
366 | 2017-03-09 20:01:22 INFO connecting api.leancloud.cn:443
367 | 2017-03-09 20:01:22 INFO connecting api.leancloud.cn:443
368 | 2017-03-09 20:01:22 INFO connecting api.leancloud.cn:443
369 | 2017-03-09 20:01:22 INFO connecting gold-cdn.xitu.io:443
370 | 2017-03-09 20:01:22 INFO connecting gold-cdn.xitu.io:443
371 | 2017-03-09 20:01:22 INFO connecting gold-cdn.xitu.io:443
372 | 2017-03-09 20:01:22 INFO connecting my-wallet-api-ms.juejin.im:443
373 | 2017-03-09 20:01:22 INFO connecting my-wallet-api-ms.juejin.im:443
374 | 2017-03-09 20:01:22 INFO connecting my-wallet-api-ms.juejin.im:443
375 | 2017-03-09 20:01:22 INFO connecting pbs.twimg.com:443
376 | 2017-03-09 20:01:22 INFO connecting pbs.twimg.com:443
377 | 2017-03-09 20:01:22 INFO connecting ubc-api-ms.juejin.im:443
378 | 2017-03-09 20:01:22 INFO connecting ubc-api-ms.juejin.im:443
379 | 2017-03-09 20:01:22 INFO connecting ubc-api-ms.juejin.im:443
380 | 2017-03-09 20:01:22 INFO connecting user-gold-cdn.xitu.io:443
381 | 2017-03-09 20:01:22 INFO connecting user-gold-cdn.xitu.io:443
382 | 2017-03-09 20:01:22 INFO connecting user-notification-api-ms.juejin.im:443
383 | 2017-03-09 20:01:22 INFO connecting user-notification-api-ms.juejin.im:443
384 | 2017-03-09 20:01:22 INFO connecting user-notification-api-ms.juejin.im:443
385 | 2017-03-09 20:01:23 INFO connecting api.leancloud.cn:443
386 | 2017-03-09 20:01:23 INFO connecting api.leancloud.cn:443
387 | 2017-03-09 20:01:24 INFO connecting api.leancloud.cn:443
388 | 2017-03-09 20:01:27 INFO connecting api.leancloud.cn:443
389 | 2017-03-09 20:01:28 INFO connecting api.leancloud.cn:443
390 | 2017-03-09 20:01:29 INFO connecting ssl.gstatic.com:443
391 | 2017-03-09 20:01:30 INFO connecting collection-set-ms.juejin.im:443
392 | 2017-03-09 20:01:30 INFO connecting api.leancloud.cn:443
393 | 2017-03-09 20:01:33 ERROR [Errno 104] Connection reset by peer
394 | 2017-03-09 20:01:33 ERROR [Errno 104] Connection reset by peer
395 | 2017-03-09 20:01:33 INFO connecting collection-set-ms.juejin.im:443
396 | 2017-03-09 20:01:38 INFO connecting pbs.twimg.com:443
397 | 2017-03-09 20:01:38 INFO connecting pbs.twimg.com:443
398 | 2017-03-09 20:01:39 INFO connecting www.google.com.hk:443
399 | 2017-03-09 20:01:39 INFO connecting mtalk.google.com:5228
400 | 2017-03-09 20:01:40 ERROR [Errno 104] Connection reset by peer
401 | 2017-03-09 20:01:40 INFO connecting cookie.pingxx.com:443
402 | 2017-03-09 20:01:40 INFO connecting cookie.pingxx.com:443
403 | 2017-03-09 20:01:43 INFO connecting google.com.hk:443
404 | 2017-03-09 20:02:44 INFO connecting github.com:443
405 | 2017-03-09 20:02:53 INFO connecting www.inoreader.com:443
406 | 2017-03-09 20:03:13 INFO connecting clients1.google.com:443
407 | 2017-03-09 20:03:44 INFO connecting mtalk.google.com:5228
408 | 2017-03-09 20:03:52 INFO connecting 113.142.84.111:80
409 | 2017-03-09 20:05:38 INFO connecting maxiang.io:443
410 | 2017-03-09 20:05:41 INFO connecting maxiang.io:443
411 | 2017-03-09 20:05:49 INFO connecting mtalk.google.com:5228
412 | 2017-03-09 20:05:56 INFO connecting 222.24.19.190:8080
413 | 2017-03-09 20:06:17 INFO connecting www.google.com.hk:443
414 | 2017-03-09 20:06:28 INFO connecting clients4.google.com:443
415 | 2017-03-09 20:07:05 INFO connecting 115.29.201.173:80
416 | 2017-03-09 20:07:44 INFO connecting github.com:443
417 | 2017-03-09 20:07:53 INFO connecting www.inoreader.com:443
418 | 2017-03-09 20:07:54 INFO connecting mtalk.google.com:5228
419 | 2017-03-09 20:07:59 INFO connecting api.xitu.io:80
420 | 2017-03-09 20:07:59 INFO connecting api.xitu.io:80
421 | 2017-03-09 20:07:59 INFO connecting api.xitu.io:80
422 | 2017-03-09 20:08:00 INFO connecting www.google.com:443
423 | 2017-03-09 20:08:00 INFO connecting www.gstatic.com:443
424 | 2017-03-09 20:08:00 INFO connecting images.unsplash.com:443
425 | 2017-03-09 20:08:00 INFO connecting images.unsplash.com:443
426 | 2017-03-09 20:08:00 INFO connecting images.unsplash.com:443
427 | 2017-03-09 20:08:00 INFO connecting images.unsplash.com:443
428 | 2017-03-09 20:08:00 INFO connecting images.unsplash.com:443
429 | 2017-03-09 20:08:00 INFO connecting images.unsplash.com:443
430 | 2017-03-09 20:08:00 INFO connecting stats.g.doubleclick.net:443
431 | 2017-03-09 20:08:09 INFO connecting pbs.twimg.com:443
432 | 2017-03-09 20:08:09 INFO connecting pbs.twimg.com:443
433 | 2017-03-09 20:08:12 ERROR [Errno 104] Connection reset by peer
434 | 2017-03-09 20:08:12 ERROR [Errno 104] Connection reset by peer
435 | 2017-03-09 20:08:12 INFO connecting cookie.pingxx.com:443
436 | 2017-03-09 20:08:12 INFO connecting cookie.pingxx.com:443
437 | 2017-03-09 20:08:30 ERROR [Errno 104] Connection reset by peer
438 | 2017-03-09 20:08:30 ERROR [Errno 104] Connection reset by peer
439 | 2017-03-09 20:08:30 ERROR [Errno 104] Connection reset by peer
440 | 2017-03-09 20:08:33 INFO connecting mtalk.google.com:5228
441 | 2017-03-09 21:17:10 ERROR poll:[Errno 4] Interrupted system call
442 | Traceback (most recent call last):
443 | File "/usr/lib/python2.7/dist-packages/shadowsocks/eventloop.py", line 198, in run
444 | events = self.poll(1)
445 | File "/usr/lib/python2.7/dist-packages/shadowsocks/eventloop.py", line 175, in poll
446 | events = self._impl.poll(timeout)
447 | File "/usr/lib/python2.7/dist-packages/shadowsocks/eventloop.py", line 63, in poll
448 | return self._epoll.poll(timeout)
449 | IOError: [Errno 4] Interrupted system call
450 | 2017-03-09 21:17:11 WARNING timed out
451 | 2017-03-09 21:17:16 INFO connecting clients4.google.com:443
452 | 2017-03-09 21:17:16 INFO connecting mtalk.google.com:443
453 | 2017-03-09 21:17:16 INFO connecting github.com:443
454 | 2017-03-09 21:17:16 INFO connecting www.google.com:443
455 | 2017-03-09 21:17:16 INFO connecting clients4.google.com:443
456 | 2017-03-09 21:17:16 INFO connecting github.com:443
457 | 2017-03-09 21:17:16 INFO connecting www.google.com:443
458 | 2017-03-09 21:17:31 INFO connecting www.google.com.hk:443
459 | 2017-03-09 21:17:31 INFO connecting www.google.com.hk:443
460 | 2017-03-09 21:17:31 INFO connecting beacons.gvt2.com:443
461 | 2017-03-09 21:17:31 INFO connecting beacons.gvt2.com:443
462 | 2017-03-09 21:17:31 INFO connecting beacons2.gvt2.com:443
463 | 2017-03-09 21:17:31 INFO connecting beacons2.gvt2.com:443
464 | 2017-03-09 21:17:31 INFO connecting beacons3.gvt2.com:443
465 | 2017-03-09 21:17:31 INFO connecting beacons3.gvt2.com:443
466 | 2017-03-09 21:17:31 INFO connecting beacons4.gvt2.com:443
467 | 2017-03-09 21:17:31 INFO connecting beacons4.gvt2.com:443
468 | 2017-03-09 21:17:31 INFO connecting beacons5.gvt2.com:443
469 | 2017-03-09 21:17:31 INFO connecting beacons5.gvt2.com:443
470 | 2017-03-09 21:17:31 INFO connecting beacons5.gvt3.com:443
471 | 2017-03-09 21:17:31 INFO connecting beacons5.gvt3.com:443
472 | 2017-03-09 21:17:31 INFO connecting clients2.google.com:443
473 | 2017-03-09 21:17:31 INFO connecting clients2.google.com:443
474 | 2017-03-09 21:18:00 INFO connecting www.googleapis.com:443
475 | 2017-03-09 21:18:00 INFO connecting mtalk.google.com:5228
476 | 2017-03-09 21:18:00 INFO connecting www.googleapis.com:443
477 | 2017-03-09 21:18:02 INFO connecting mtalk.google.com:443
478 | 2017-03-09 21:18:02 INFO connecting www.google.com:443
479 | 2017-03-09 21:18:02 INFO connecting www.google.com:443
480 | 2017-03-09 21:18:17 INFO connecting beacons.gvt2.com:443
481 | 2017-03-09 21:18:17 INFO connecting google.com:443
482 | 2017-03-09 21:18:17 INFO connecting beacons.gvt2.com:443
483 | 2017-03-09 21:18:17 INFO connecting google.com:443
484 | 2017-03-09 21:18:17 INFO connecting beacons2.gvt2.com:443
485 | 2017-03-09 21:18:17 INFO connecting beacons2.gvt2.com:443
486 | 2017-03-09 21:18:17 INFO connecting beacons.gvt2.com:443
487 | 2017-03-09 21:18:17 INFO connecting beacons.gvt2.com:443
488 | 2017-03-09 21:18:17 INFO connecting beacons3.gvt2.com:443
489 | 2017-03-09 21:18:17 INFO connecting beacons3.gvt2.com:443
490 | 2017-03-09 21:18:17 INFO connecting beacons2.gvt2.com:443
491 | 2017-03-09 21:18:17 INFO connecting beacons2.gvt2.com:443
492 | 2017-03-09 21:18:17 INFO connecting beacons4.gvt2.com:443
493 | 2017-03-09 21:18:17 INFO connecting beacons4.gvt2.com:443
494 | 2017-03-09 21:18:17 INFO connecting beacons3.gvt2.com:443
495 | 2017-03-09 21:18:17 INFO connecting beacons3.gvt2.com:443
496 | 2017-03-09 21:18:17 INFO connecting beacons5.gvt2.com:443
497 | 2017-03-09 21:18:17 INFO connecting beacons5.gvt2.com:443
498 | 2017-03-09 21:18:17 INFO connecting beacons4.gvt2.com:443
499 | 2017-03-09 21:18:17 INFO connecting beacons4.gvt2.com:443
500 | 2017-03-09 21:18:17 INFO connecting beacons5.gvt3.com:443
501 | 2017-03-09 21:18:17 INFO connecting beacons5.gvt3.com:443
502 | 2017-03-09 21:18:17 INFO connecting beacons5.gvt2.com:443
503 | 2017-03-09 21:18:17 INFO connecting beacons5.gvt2.com:443
504 | 2017-03-09 21:18:17 INFO connecting clients2.google.com:443
505 | 2017-03-09 21:18:17 INFO connecting clients2.google.com:443
506 | 2017-03-09 21:18:17 INFO connecting beacons5.gvt3.com:443
507 | 2017-03-09 21:18:17 INFO connecting beacons5.gvt3.com:443
508 | 2017-03-09 21:18:41 INFO connecting clients2.google.com:443
509 | 2017-03-09 21:18:41 INFO connecting www.google.com.hk:443
510 | 2017-03-09 21:18:41 INFO connecting clients2.google.com:443
511 | 2017-03-09 21:18:41 INFO connecting www.google.com.hk:443
512 | 2017-03-09 21:18:46 INFO connecting www.googleapis.com:443
513 | 2017-03-09 21:18:46 INFO connecting mtalk.google.com:5228
514 | 2017-03-09 21:18:46 INFO connecting www.googleapis.com:443
515 | 2017-03-09 21:18:46 INFO connecting beacons5.gvt2.com:443
516 | 2017-03-09 21:18:46 INFO connecting beacons5.gvt2.com:443
517 | 2017-03-09 21:18:48 INFO connecting clients4.google.com:443
518 | 2017-03-09 21:18:48 INFO connecting www.google.com:443
519 | 2017-03-09 21:18:48 INFO connecting mtalk.google.com:443
520 | 2017-03-09 21:18:48 INFO connecting clients4.google.com:443
521 | 2017-03-09 21:18:48 INFO connecting www.google.com:443
522 | 2017-03-09 21:18:48 INFO connecting beacons5.gvt3.com:443
523 | 2017-03-09 21:18:48 INFO connecting beacons5.gvt3.com:443
524 | 2017-03-09 21:18:58 INFO connecting clients2.google.com:443
525 | 2017-03-09 21:18:58 INFO connecting clients2.google.com:443
526 | 2017-03-09 21:19:15 INFO connecting clients1.google.com:443
527 | 2017-03-09 21:19:15 INFO connecting clients1.google.com:443
528 | 2017-03-09 21:19:15 INFO connecting beacons.gvt2.com:443
529 | 2017-03-09 21:19:15 INFO connecting beacons.gvt2.com:443
530 | 2017-03-09 21:19:16 INFO connecting clients1.google.com:443
531 | 2017-03-09 21:19:16 INFO connecting clients1.google.com:443
532 | 2017-03-09 21:19:16 INFO connecting beacons2.gvt2.com:443
533 | 2017-03-09 21:19:16 INFO connecting beacons2.gvt2.com:443
534 | 2017-03-09 21:19:18 INFO connecting clients1.google.com:443
535 | 2017-03-09 21:19:18 INFO connecting clients1.google.com:443
536 | 2017-03-09 21:19:18 INFO connecting beacons3.gvt2.com:443
537 | 2017-03-09 21:19:18 INFO connecting beacons3.gvt2.com:443
538 | 2017-03-09 21:19:21 INFO connecting clients1.google.com:443
539 | 2017-03-09 21:19:21 INFO connecting clients1.google.com:443
540 | 2017-03-09 21:19:21 INFO connecting beacons4.gvt2.com:443
541 | 2017-03-09 21:19:21 INFO connecting beacons4.gvt2.com:443
542 | 2017-03-09 21:19:28 INFO connecting clients1.google.com:443
543 | 2017-03-09 21:19:28 INFO connecting clients1.google.com:443
544 | 2017-03-09 21:19:28 INFO connecting beacons3.gvt2.com:443
545 | 2017-03-09 21:19:28 INFO connecting beacons5.gvt2.com:443
546 | 2017-03-09 21:19:28 INFO connecting beacons3.gvt2.com:443
547 | 2017-03-09 21:19:28 INFO connecting beacons5.gvt2.com:443
548 | 2017-03-09 21:19:28 INFO connecting beacons4.gvt2.com:443
549 | 2017-03-09 21:19:28 INFO connecting beacons4.gvt2.com:443
550 | 2017-03-09 21:19:28 INFO connecting beacons5.gvt3.com:443
551 | 2017-03-09 21:19:28 INFO connecting beacons5.gvt3.com:443
552 | 2017-03-09 21:19:32 INFO connecting www.googleapis.com:443
553 | 2017-03-09 21:19:32 INFO connecting mtalk.google.com:5228
554 | 2017-03-09 21:19:32 INFO connecting www.googleapis.com:443
555 | 2017-03-09 21:19:32 INFO connecting clients2.google.com:443
556 | 2017-03-09 21:19:32 INFO connecting clients2.google.com:443
557 | 2017-03-09 21:19:35 INFO connecting www.google.com:443
558 | 2017-03-09 21:19:35 INFO connecting mtalk.google.com:443
559 | 2017-03-09 21:19:35 INFO connecting www.google.com:443
560 | 2017-03-09 21:19:39 INFO connecting clients2.google.com:443
561 | 2017-03-09 21:19:39 INFO connecting clients2.google.com:443
562 | 2017-03-09 21:19:43 INFO connecting clients1.google.com:443
563 | 2017-03-09 21:19:43 INFO connecting clients1.google.com:443
564 | 2017-03-09 21:20:06 INFO connecting clients1.google.com:443
565 | 2017-03-09 21:20:06 INFO connecting clients1.google.com:443
566 | 2017-03-09 21:20:20 INFO connecting mtalk.google.com:5228
567 | 2017-03-09 21:20:20 INFO connecting www.google.com:443
568 | 2017-03-09 21:20:20 INFO connecting www.googleapis.com:443
569 | 2017-03-09 21:20:21 INFO connecting 211.137.133.5:80
570 | 2017-03-09 21:20:21 INFO connecting beacons3.gvt2.com:443
571 | 2017-03-09 21:20:21 INFO connecting clients4.google.com:443
572 | 2017-03-09 21:20:36 INFO connecting clients1.google.com:443
573 | 2017-03-09 21:20:38 INFO connecting api.xitu.io:80
574 | 2017-03-09 21:20:38 INFO connecting api.xitu.io:80
575 | 2017-03-09 21:20:38 INFO connecting api.xitu.io:80
576 | 2017-03-09 21:20:38 INFO connecting www.google.com.hk:443
577 | 2017-03-09 21:20:38 INFO connecting www.gstatic.com:443
578 | 2017-03-09 21:20:38 INFO connecting images.unsplash.com:443
579 | 2017-03-09 21:20:38 INFO connecting images.unsplash.com:443
580 | 2017-03-09 21:20:38 INFO connecting images.unsplash.com:443
581 | 2017-03-09 21:20:38 INFO connecting images.unsplash.com:443
582 | 2017-03-09 21:20:38 INFO connecting images.unsplash.com:443
583 | 2017-03-09 21:20:38 INFO connecting images.unsplash.com:443
584 | 2017-03-09 21:20:38 INFO connecting www.google.com.hk:443
585 | 2017-03-09 21:20:38 INFO connecting www.google.com.hk:443
586 | 2017-03-09 21:20:39 INFO connecting www.google.com.hk:443
587 | 2017-03-09 21:20:39 INFO connecting www.google.com.hk:443
588 | 2017-03-09 21:20:39 INFO connecting www.google.com.hk:443
589 | 2017-03-09 21:20:40 INFO connecting www.acfun.tv:80
590 | 2017-03-09 21:20:40 INFO connecting www.acfun.tv:80
591 | 2017-03-09 21:20:42 INFO connecting clients4.google.com:443
592 | 2017-03-09 21:20:50 INFO connecting www.google.com.hk:443
593 | 2017-03-09 21:20:51 INFO connecting beacons4.gvt2.com:443
594 | 2017-03-09 21:21:20 INFO connecting mtalk.google.com:5228
595 | 2017-03-09 21:21:32 INFO connecting clients4.google.com:443
596 | 2017-03-09 21:21:32 INFO connecting mtalk.google.com:443
597 | 2017-03-09 21:21:32 INFO connecting clients4.google.com:443
598 | 2017-03-09 21:21:32 INFO connecting clients2.google.com:443
599 | 2017-03-09 21:21:32 INFO connecting clients2.google.com:443
600 | 2017-03-09 21:21:32 INFO connecting clients4.google.com:443
601 | 2017-03-09 21:21:32 INFO connecting clients2.google.com:443
602 | 2017-03-09 21:21:32 INFO connecting clients4.google.com:443
603 | 2017-03-09 21:21:32 INFO connecting clients2.google.com:443
604 | 2017-03-09 21:21:34 INFO connecting clients4.google.com:443
605 | 2017-03-09 21:21:34 INFO connecting clients4.google.com:443
606 | 2017-03-09 21:21:34 INFO connecting mtalk.google.com:5228
607 | 2017-03-09 21:21:34 INFO connecting www.google.com:443
608 | 2017-03-09 21:21:34 INFO connecting clients4.google.com:443
609 | 2017-03-09 21:21:34 INFO connecting clients4.google.com:443
610 | 2017-03-09 21:21:34 INFO connecting www.google.com:443
611 | 2017-03-09 21:21:36 INFO connecting clients1.google.com:443
612 | 2017-03-09 21:21:36 INFO connecting clients1.google.com:443
613 | 2017-03-09 21:21:41 INFO connecting clients2.google.com:443
614 | 2017-03-09 21:21:41 INFO connecting clients2.google.com:443
615 | 2017-03-09 21:22:06 INFO connecting clients1.google.com:443
616 | 2017-03-09 21:22:06 INFO connecting clients1.google.com:443
617 | 2017-03-09 21:22:15 INFO connecting google.com:443
618 | 2017-03-09 21:22:15 INFO connecting google.com:443
619 | 2017-03-09 21:22:15 INFO connecting clients2.google.com:443
620 | 2017-03-09 21:22:15 INFO connecting clients2.google.com:443
621 | 2017-03-09 21:22:21 INFO connecting mtalk.google.com:443
622 | 2017-03-09 21:22:21 INFO connecting www.google.com:443
623 | 2017-03-09 21:22:21 INFO connecting clients4.google.com:443
624 | 2017-03-09 21:22:21 INFO connecting www.google.com:443
625 | 2017-03-09 21:22:21 INFO connecting clients4.google.com:443
626 | 2017-03-09 21:22:21 INFO connecting clients4.google.com:443
627 | 2017-03-09 21:22:21 INFO connecting clients4.google.com:443
628 | 2017-03-09 21:22:24 INFO connecting clients4.google.com:443
629 | 2017-03-09 21:22:24 INFO connecting www.google.com:443
630 | 2017-03-09 21:22:24 INFO connecting mtalk.google.com:5228
631 | 2017-03-09 21:22:24 INFO connecting clients4.google.com:443
632 | 2017-03-09 21:22:24 INFO connecting www.google.com:443
633 | 2017-03-09 21:22:36 INFO connecting clients1.google.com:443
634 | 2017-03-09 21:22:36 INFO connecting clients1.google.com:443
635 | 2017-03-09 21:22:41 INFO connecting clients4.google.com:443
636 | 2017-03-09 21:22:41 INFO connecting mtalk.google.com:443
637 | 2017-03-09 21:22:41 INFO connecting www.google.com:443
638 | 2017-03-09 21:22:41 INFO connecting clients4.google.com:443
639 | 2017-03-09 21:22:41 INFO connecting www.google.com:443
640 | 2017-03-09 21:22:41 INFO connecting clients4.google.com:443
641 | 2017-03-09 21:22:41 INFO connecting clients4.google.com:443
642 | 2017-03-09 21:22:41 INFO connecting clients4.google.com:443
643 | 2017-03-09 21:22:41 INFO connecting clients4.google.com:443
644 | 2017-03-09 21:22:45 ERROR [Errno 22] Invalid argument
645 | 2017-03-09 21:22:45 ERROR [Errno 22] Invalid argument
646 | 2017-03-09 21:22:45 ERROR [Errno 22] Invalid argument
647 | 2017-03-09 21:22:49 INFO connecting mtalk.google.com:5228
648 | 2017-03-09 21:22:49 INFO connecting www.google.com:443
649 | 2017-03-09 21:22:49 INFO connecting clients4.google.com:443
650 | 2017-03-09 21:23:06 INFO connecting clients1.google.com:443
651 | 2017-03-09 21:23:23 INFO connecting clients5.google.com:443
652 | 2017-03-09 21:23:23 INFO connecting notifications.google.com:443
653 | 2017-03-09 21:24:23 ERROR [Errno 104] Connection reset by peer
654 | 2017-03-09 21:24:23 ERROR [Errno 104] Connection reset by peer
655 | 2017-03-09 21:24:23 INFO connecting clients5.google.com:443
656 | 2017-03-09 21:24:23 INFO connecting notifications.google.com:443
657 | 2017-03-09 21:24:26 INFO connecting ogs.google.com:443
658 | 2017-03-09 21:26:32 INFO connecting www.google.com:443
659 | 2017-03-09 21:26:32 INFO connecting www.google.com:443
660 | 2017-03-09 21:26:32 INFO connecting www.google.com:443
661 | 2017-03-09 21:26:32 INFO connecting www.google.com:443
662 | 2017-03-09 21:26:32 INFO connecting www.google.com:443
663 | 2017-03-09 21:26:35 INFO connecting www.google.com:443
664 | 2017-03-09 21:26:37 INFO connecting clients5.google.com:443
665 | 2017-03-09 21:26:41 INFO connecting clients1.google.com:443
666 | 2017-03-09 21:31:01 INFO connecting clients4.google.com:443
667 | 2017-03-09 21:31:28 INFO connecting clients4.google.com:443
668 | 2017-03-09 21:32:04 INFO connecting mtalk.google.com:5228
669 | 2017-03-09 21:32:15 INFO connecting www.google.com:443
670 | 2017-03-09 21:34:10 INFO connecting mtalk.google.com:5228
671 | 2017-03-09 21:36:14 INFO connecting mtalk.google.com:5228
672 | 2017-03-09 21:38:19 INFO connecting mtalk.google.com:5228
673 | 2017-03-09 21:38:45 INFO connecting www.google.com:443
674 | 2017-03-09 21:38:45 INFO connecting www.google.com:443
675 | 2017-03-09 21:38:45 INFO connecting www.google.com:443
676 | 2017-03-09 21:38:48 INFO connecting clients5.google.com:443
677 | 2017-03-09 21:38:49 INFO connecting ogs.google.com:443
678 | 2017-03-09 21:38:53 INFO connecting notifications.google.com:443
679 | 2017-03-09 21:38:55 INFO connecting id.google.com:443
680 | 2017-03-09 21:38:55 INFO connecting play.google.com:443
681 | 2017-03-09 21:38:55 INFO connecting apis.google.com:443
682 | 2017-03-09 21:39:04 ERROR [Errno 104] Connection reset by peer
683 | 2017-03-09 21:39:04 ERROR [Errno 104] Connection reset by peer
684 | 2017-03-09 21:39:04 ERROR [Errno 104] Connection reset by peer
685 | 2017-03-09 21:39:04 INFO connecting clients4.google.com:443
686 | 2017-03-09 21:40:25 INFO connecting mtalk.google.com:5228
687 | 2017-03-09 21:42:12 INFO connecting www.google.com:443
688 | 2017-03-09 21:42:25 INFO connecting clients4.google.com:443
689 | 2017-03-09 21:42:30 INFO connecting mtalk.google.com:5228
690 | 2017-03-09 21:43:56 INFO connecting play.google.com:443
691 | 2017-03-09 21:43:57 INFO connecting notifications.google.com:443
692 | 2017-03-09 21:44:35 INFO connecting mtalk.google.com:5228
693 | 2017-03-09 21:46:40 INFO connecting mtalk.google.com:5228
694 | 2017-03-09 21:47:06 INFO connecting clients4.google.com:443
695 | 2017-03-09 21:48:45 INFO connecting mtalk.google.com:5228
696 | 2017-03-09 21:50:50 INFO connecting mtalk.google.com:5228
697 | 2017-03-09 21:52:55 INFO connecting mtalk.google.com:5228
698 | 2017-03-09 21:54:12 INFO connecting www.google.com:443
699 | 2017-03-09 21:54:14 INFO connecting clients1.google.com:443
700 | 2017-03-09 21:54:18 INFO connecting clients4.google.com:443
701 | 2017-03-09 21:54:26 INFO connecting clients4.google.com:443
702 | 2017-03-09 21:55:00 INFO connecting mtalk.google.com:5228
703 | 2017-03-09 21:57:05 INFO connecting mtalk.google.com:5228
704 | 2017-03-09 21:57:09 INFO connecting clients1.google.com:443
705 | 2017-03-09 21:57:39 INFO connecting www.google.com:443
706 | 2017-03-09 21:57:39 INFO connecting www.google.com:443
707 | 2017-03-09 21:57:39 INFO connecting www.google.com:443
708 | 2017-03-09 21:57:39 INFO connecting www.google.com:443
709 | 2017-03-09 21:57:39 INFO connecting www.google.com:443
710 | 2017-03-09 21:57:39 INFO connecting www.google.com:443
711 | 2017-03-09 21:57:46 INFO connecting clients5.google.com:443
712 | 2017-03-09 21:57:47 INFO connecting ogs.google.com:443
713 | 2017-03-09 21:58:48 ERROR [Errno 104] Connection reset by peer
714 | 2017-03-09 21:58:48 ERROR [Errno 104] Connection reset by peer
715 | 2017-03-09 21:58:48 ERROR [Errno 104] Connection reset by peer
716 | 2017-03-09 21:58:48 ERROR [Errno 104] Connection reset by peer
717 | 2017-03-09 21:58:48 ERROR [Errno 104] Connection reset by peer
718 | 2017-03-09 21:58:48 ERROR [Errno 104] Connection reset by peer
719 | 2017-03-09 21:58:48 INFO connecting google.com:443
720 | 2017-03-09 21:59:10 INFO connecting mtalk.google.com:5228
721 | 2017-03-09 22:01:00 INFO connecting notifications.google.com:443
722 | 2017-03-09 22:01:15 INFO connecting mtalk.google.com:5228
723 | 2017-03-09 22:03:21 INFO connecting mtalk.google.com:5228
724 | 2017-03-09 22:03:37 INFO connecting clients4.google.com:443
725 | 2017-03-09 22:05:26 INFO connecting mtalk.google.com:5228
726 | 2017-03-09 22:07:31 INFO connecting mtalk.google.com:5228
727 | 2017-03-09 22:09:36 INFO connecting mtalk.google.com:5228
728 | 2017-03-09 22:11:41 INFO connecting mtalk.google.com:5228
729 | 2017-03-09 22:12:05 INFO connecting clients4.google.com:443
730 | 2017-03-09 22:13:46 INFO connecting mtalk.google.com:5228
731 | 2017-03-09 22:13:57 INFO connecting play.google.com:443
732 | 2017-03-09 22:15:46 INFO connecting www.google.com:443
733 | 2017-03-09 22:15:46 INFO connecting www.google.com:443
734 | 2017-03-09 22:15:46 INFO connecting www.google.com:443
735 | 2017-03-09 22:15:46 INFO connecting www.google.com:443
736 | 2017-03-09 22:15:46 INFO connecting www.google.com:443
737 | 2017-03-09 22:15:49 INFO connecting clients5.google.com:443
738 | 2017-03-09 22:15:50 INFO connecting ogs.google.com:443
739 | 2017-03-09 22:15:51 INFO connecting mtalk.google.com:5228
740 | 2017-03-09 22:15:55 INFO connecting notifications.google.com:443
741 | 2017-03-09 22:15:55 INFO connecting apis.google.com:443
742 | 2017-03-09 22:15:55 INFO connecting play.google.com:443
743 | 2017-03-09 22:16:05 ERROR [Errno 104] Connection reset by peer
744 | 2017-03-09 22:16:05 ERROR [Errno 104] Connection reset by peer
745 | 2017-03-09 22:16:05 ERROR [Errno 104] Connection reset by peer
746 | 2017-03-09 22:16:05 ERROR [Errno 104] Connection reset by peer
747 | 2017-03-09 22:16:05 ERROR [Errno 104] Connection reset by peer
748 | 2017-03-09 22:16:05 INFO connecting id.google.com:443
749 | 2017-03-09 22:16:13 ERROR [Errno 104] Connection reset by peer
750 | 2017-03-09 22:16:13 ERROR [Errno 104] Connection reset by peer
751 | 2017-03-09 22:16:13 INFO connecting notifications.google.com:443
752 | 2017-03-09 22:16:14 INFO connecting clients4.google.com:443
753 | 2017-03-09 22:17:17 ERROR [Errno 104] Connection reset by peer
754 | 2017-03-09 22:17:17 INFO connecting google.com:443
755 | 2017-03-09 22:17:56 INFO connecting mtalk.google.com:5228
756 | 2017-03-09 22:20:01 INFO connecting mtalk.google.com:5228
757 | 2017-03-09 22:20:23 INFO connecting clients2.google.com:443
758 | 2017-03-09 22:20:57 INFO connecting play.google.com:443
759 | 2017-03-09 22:21:01 INFO connecting notifications.google.com:443
760 | 2017-03-09 22:22:05 INFO connecting google.com:443
761 | 2017-03-09 22:22:07 INFO connecting mtalk.google.com:5228
762 | 2017-03-09 22:22:29 INFO connecting www.google.com:443
763 | 2017-03-09 22:22:29 INFO connecting www.google.com:443
764 | 2017-03-09 22:22:30 INFO connecting www.google.com:443
765 | 2017-03-09 22:22:32 INFO connecting clients5.google.com:443
766 | 2017-03-09 22:22:33 INFO connecting ogs.google.com:443
767 | 2017-03-09 22:22:38 INFO connecting apis.google.com:443
768 | 2017-03-09 22:22:38 INFO connecting play.google.com:443
769 | 2017-03-09 22:22:49 ERROR [Errno 104] Connection reset by peer
770 | 2017-03-09 22:22:49 ERROR [Errno 104] Connection reset by peer
771 | 2017-03-09 22:22:49 ERROR [Errno 104] Connection reset by peer
772 | 2017-03-09 22:22:49 ERROR [Errno 104] Connection reset by peer
773 | 2017-03-09 22:22:49 ERROR [Errno 104] Connection reset by peer
774 | 2017-03-09 22:22:49 INFO connecting clients4.google.com:443
775 | 2017-03-09 22:23:38 INFO connecting clients5.google.com:443
776 | 2017-03-09 22:23:43 INFO connecting apis.google.com:443
777 | 2017-03-09 22:23:43 INFO connecting play.google.com:443
778 | 2017-03-09 22:24:12 INFO connecting mtalk.google.com:5228
779 | 2017-03-09 22:26:17 INFO connecting mtalk.google.com:5228
780 | 2017-03-09 22:28:22 INFO connecting mtalk.google.com:5228
781 | 2017-03-09 22:28:46 INFO connecting play.google.com:443
782 | 2017-03-09 22:28:46 INFO connecting notifications.google.com:443
783 | 2017-03-09 22:30:13 INFO connecting www.google.com:443
784 | 2017-03-09 22:30:25 INFO connecting clients4.google.com:443
785 | 2017-03-09 22:30:27 INFO connecting mtalk.google.com:5228
786 | 2017-03-09 22:30:34 INFO connecting clients1.google.com:443
787 | 2017-03-09 22:30:55 INFO connecting clients4.google.com:443
788 | 2017-03-09 22:31:05 ERROR [Errno 104] Connection reset by peer
789 | 2017-03-09 22:31:05 INFO connecting clients4.google.com:443
790 | 2017-03-09 22:31:12 INFO connecting notifications.google.com:443
791 | 2017-03-09 22:31:23 INFO connecting www.google.com:443
792 | 2017-03-09 22:31:23 INFO connecting www.google.com:443
793 | 2017-03-09 22:31:23 INFO connecting www.google.com:443
794 | 2017-03-09 22:31:23 INFO connecting www.google.com:443
795 | 2017-03-09 22:31:23 INFO connecting www.google.com:443
796 | 2017-03-09 22:31:23 INFO connecting www.google.com:443
797 | 2017-03-09 22:31:33 INFO connecting www.google.com:443
798 | 2017-03-09 22:31:33 INFO connecting www.google.com:443
799 | 2017-03-09 22:31:33 INFO connecting www.google.com:443
800 | 2017-03-09 22:31:33 INFO connecting www.google.com:443
801 | 2017-03-09 22:31:33 INFO connecting www.google.com:443
802 | 2017-03-09 22:31:33 INFO connecting www.google.com:443
803 | 2017-03-09 22:31:33 INFO connecting www.google.com:443
804 | 2017-03-09 22:31:33 INFO connecting www.google.com:443
805 | 2017-03-09 22:31:33 INFO connecting www.google.com:443
806 | 2017-03-09 22:31:33 INFO connecting www.google.com:443
807 | 2017-03-09 22:31:33 INFO connecting www.google.com:443
808 | 2017-03-09 22:32:30 ERROR [Errno 104] Connection reset by peer
809 | 2017-03-09 22:32:30 ERROR [Errno 104] Connection reset by peer
810 | 2017-03-09 22:32:30 ERROR [Errno 104] Connection reset by peer
811 | 2017-03-09 22:32:30 ERROR [Errno 104] Connection reset by peer
812 | 2017-03-09 22:32:30 ERROR [Errno 104] Connection reset by peer
813 | 2017-03-09 22:32:30 ERROR [Errno 104] Connection reset by peer
814 | 2017-03-09 22:32:30 ERROR [Errno 104] Connection reset by peer
815 | 2017-03-09 22:32:30 ERROR [Errno 104] Connection reset by peer
816 | 2017-03-09 22:32:30 ERROR [Errno 104] Connection reset by peer
817 | 2017-03-09 22:32:30 ERROR [Errno 104] Connection reset by peer
818 | 2017-03-09 22:32:30 INFO connecting clients4.google.com:443
819 | 2017-03-09 22:32:32 INFO connecting mtalk.google.com:5228
820 | 2017-03-09 22:34:09 INFO connecting clients5.google.com:443
821 | 2017-03-09 22:34:12 INFO connecting ogs.google.com:443
822 | 2017-03-09 22:34:17 INFO connecting notifications.google.com:443
823 | 2017-03-09 22:34:17 INFO connecting play.google.com:443
824 | 2017-03-09 22:34:17 INFO connecting apis.google.com:443
825 | 2017-03-09 22:34:18 INFO connecting play.google.com:443
826 | 2017-03-09 22:34:37 INFO connecting mtalk.google.com:5228
827 | 2017-03-09 22:35:30 ERROR [Errno 104] Connection reset by peer
828 | 2017-03-09 22:35:30 ERROR [Errno 104] Connection reset by peer
829 | 2017-03-09 22:35:30 ERROR [Errno 104] Connection reset by peer
830 | 2017-03-09 22:35:30 ERROR [Errno 104] Connection reset by peer
831 | 2017-03-09 22:35:30 INFO connecting clients4.google.com:443
832 | 2017-03-09 22:36:42 INFO connecting mtalk.google.com:5228
833 | 2017-03-09 22:37:31 INFO connecting www.google.com:443
834 | 2017-03-09 22:37:36 INFO connecting ogs.google.com:443
835 | 2017-03-09 22:37:41 INFO connecting notifications.google.com:443
836 | 2017-03-09 22:37:41 INFO connecting play.google.com:443
837 | 2017-03-09 22:37:41 INFO connecting apis.google.com:443
838 | 2017-03-09 22:37:42 INFO connecting play.google.com:443
839 | 2017-03-09 22:37:52 ERROR [Errno 104] Connection reset by peer
840 | 2017-03-09 22:37:52 ERROR [Errno 104] Connection reset by peer
841 | 2017-03-09 22:37:52 ERROR [Errno 104] Connection reset by peer
842 | 2017-03-09 22:37:52 INFO connecting clients1.google.com:443
843 | 2017-03-09 22:37:56 INFO connecting clients4.google.com:443
844 | 2017-03-09 22:38:48 INFO connecting mtalk.google.com:5228
845 | 2017-03-09 22:39:19 INFO connecting notifications.google.com:443
846 | 2017-03-09 22:39:57 INFO connecting www.google.com:443
847 | 2017-03-09 22:39:57 INFO connecting www.google.com:443
848 | 2017-03-09 22:40:33 ERROR [Errno 104] Connection reset by peer
849 | 2017-03-09 22:40:33 INFO connecting apis.google.com:443
850 | 2017-03-09 22:40:33 INFO connecting clients5.google.com:443
851 | 2017-03-09 22:40:36 INFO connecting ogs.google.com:443
852 | 2017-03-09 22:40:41 INFO connecting play.google.com:443
853 | 2017-03-09 22:40:46 ERROR [Errno 104] Connection reset by peer
854 | 2017-03-09 22:40:46 INFO connecting apis.google.com:443
855 | 2017-03-09 22:40:53 INFO connecting mtalk.google.com:5228
856 | 2017-03-09 22:41:54 ERROR [Errno 104] Connection reset by peer
857 | 2017-03-09 22:41:54 ERROR [Errno 104] Connection reset by peer
858 | 2017-03-09 22:41:54 INFO connecting google.com:443
859 | 2017-03-09 22:42:58 INFO connecting mtalk.google.com:5228
860 | 2017-03-09 22:43:25 INFO connecting www.google.com:443
861 | 2017-03-09 22:43:36 INFO connecting clients4.google.com:443
862 | 2017-03-09 22:43:53 INFO connecting clients5.google.com:443
863 | 2017-03-09 22:43:54 INFO connecting ogs.google.com:443
864 | 2017-03-09 22:43:59 INFO connecting apis.google.com:443
865 | 2017-03-09 22:43:59 INFO connecting notifications.google.com:443
866 | 2017-03-09 22:43:59 INFO connecting play.google.com:443
867 | 2017-03-09 22:44:01 INFO connecting play.google.com:443
868 | 2017-03-09 22:45:03 INFO connecting mtalk.google.com:5228
869 | 2017-03-09 22:45:43 ERROR [Errno 104] Connection reset by peer
870 | 2017-03-09 22:45:43 ERROR [Errno 104] Connection reset by peer
871 | 2017-03-09 22:45:43 ERROR [Errno 104] Connection reset by peer
872 | 2017-03-09 22:45:43 ERROR [Errno 104] Connection reset by peer
873 | 2017-03-09 22:45:43 INFO connecting clients1.google.com:443
874 | 2017-03-09 22:47:09 INFO connecting mtalk.google.com:5228
875 | 2017-03-09 22:49:14 INFO connecting mtalk.google.com:5228
876 | 2017-03-09 22:51:19 INFO connecting mtalk.google.com:5228
877 | 2017-03-09 22:53:25 INFO connecting mtalk.google.com:5228
878 | 2017-03-09 22:54:45 INFO connecting clients4.google.com:443
879 | 2017-03-09 22:55:30 INFO connecting mtalk.google.com:5228
880 | 2017-03-09 22:57:35 INFO connecting mtalk.google.com:5228
881 | 2017-03-09 22:59:40 INFO connecting mtalk.google.com:5228
882 | 2017-03-09 23:01:45 INFO connecting mtalk.google.com:5228
883 |
--------------------------------------------------------------------------------
/module.md:
--------------------------------------------------------------------------------
1 | .jshintrc : JSHint是一种JS代码检查工具,这个文件是其个性化的配置文件
2 | .gitinore : 是git配置需要忽略文件的配置文件
3 | .travis.yml : travis是一个持续集成的平台,这是其配置文件
4 |
5 | nodeclub 以 express + mongodb + mongoose 作为基本框架, 典型的 MVC 应用
6 | Model: 对应mongoose orm, models目录
7 | view: ejs模板, views目录
8 | controler:express middleware , contollers目录
9 |
10 | ### 使用的模块
11 |
12 | #### bcryptjs
13 |
14 | bcrypt是一个跨平台的文件加密工具,How To Safely Store A Password
15 |
16 | #### bytes
17 |
18 | bytes(1024);
19 | // output: '1kB'
20 |
21 | bytes(1000);
22 | // output: '1000B'
23 |
24 | bytes(1000, {thousandsSeparator: ' '});
25 | // output: '1 000B'
26 |
27 | bytes(1024 * 1.7, {decimalPlaces: 0});
28 | // output: '2kB'
29 |
30 | bytes(1024, {unitSeparator: ' '});
31 | // output: '1 kB'
32 |
33 | #### colors
34 |
35 | 让你的console.log呈现颜色
36 |
37 | var colors = require('colors');
38 |
39 | console.log('hello'.green); // outputs green text
40 | console.log('i like cake and pies'.underline.red) // outputs red underlined text
41 |
42 | #### compression
43 |
44 | 代码压缩中间件
45 | 支持:deflate,gzip
46 |
47 | #### connect-redis
48 |
49 | connect-redis is a Redis session store backed by node_redis
50 | connect-radis 是一个Radis的会话缓存,被node_redis支持‘
51 |
52 | #### cookie-parser
53 |
54 | Parse Cookie header and populate req.cookies with an object keyed by the cookie names.
55 | Optionally you may enable signed cookie support by passing a secret string,
56 | which assigns req.secret so it may be used by other middleware.
57 |
58 | 解析Cookie头部并通过cookie名称键入一个对象填充req.cookies
59 | 你可以传递一个私密的字符串来登记cookie的支持,其中分配req.secret来被其他中间件使用。
60 |
61 | #### cors
62 |
63 | CORS是一个提供一个Connect/Express中间件的node.js包,他可以被用作启用CORS(Cross-Origin Resource Sharing 跨源资源共享)并附带好些参数
64 |
65 | #### csurf
66 |
67 | Node.js CSRF(Cross-Site Request Forgery 跨站请求伪造) 保护中间件
68 |
69 | 要求一个session中间件或者cookie-parser首先被初始化
70 |
71 | + 如果你正设置"cookie" 参数为非假值,之后你必须在这个模块之前使用'cookie-parser'
72 | + 除此之外,你逆序使用一个session中间件在这个模块之前,比如:
73 | + express-session
74 | + cookie-session
75 |
76 | https://github.com/pillarjs/understanding-csrf
77 |
78 | #### data2xml
79 |
80 | 转换数据为xml
81 |
82 | #### ejs-mate
83 |
84 | Express 4.x layout,局部,块状的模板功能forEJS模板引擎
85 | 先前支持 include 但是已必须使用EJS1.0.x版本
86 |
87 |
88 | #### eventproxy
89 |
90 | 事件订阅型的异步模式
91 |
92 | ##### express-session
93 |
94 | Simple session middleware for Express,express session 设置
95 |
96 | #### helmet
97 | Helmet helps you secure your Express apps by setting various HTTP headers.
98 | 设置各种各样的http头部,一些安全方面的头部
99 |
100 | #### ioredis
101 |
102 | A robust, performance-focused and full-featured Redis client for Node and io.js.
103 | 为Node和io.js提供的redis客户端
104 |
105 |
106 | #### jpush-sdk
107 | 极光推送sdk
108 |
109 | #### loader-builder
110 |
111 | 感觉和webpack功能差不多,就是提供一系列的编译,压缩,合并
112 |
113 | #### loader
114 | Node静态资源加载器。
115 |
116 | #### lodash
117 |
118 | Lodash makes JavaScript easier by taking the hassle out of working with arrays,
119 | numbers, objects, strings, etc. Lodash’s modular methods are great for:
120 |
121 | 好像是提供一系列的数组,对象,字符串,函数的方法的封装(很强大)
122 |
123 | #### log4js
124 |
125 | 好像是对于原来console.log()功能的加强
126 |
127 | #### markdown-it
128 |
129 | 扩展性的markdown语法.速度快,安全,自定义插件
130 |
131 | #### memory-cache
132 |
133 | 一个简单的内存缓存
134 |
135 | #### method-override
136 |
137 | 复写方法,让你在客户端不能用http某些方法的地方,使用如put,delete等方法
138 |
139 | 比如form只支持get,post方法,使用这个模块就可以使用其他的方法了
140 |
141 | #### moment
142 | 一个轻量的JavaScript时间库
143 | 各种开发环境都可以用,包括前端
144 |
145 | #### mongoose
146 |
147 | mongodb orm 用于把mongodb数据库里面的数据抽象成对象,然后供node操作
148 |
149 | #### multiline
150 |
151 | 处理多行字符串,原先是要使用+来连接换行的字符串,用这个可以在函数内随意编写多行字符串
152 |
153 | #### node-uuid
154 |
155 | 生成通用唯一标识码(uuid),v1(time-based),v(random)
156 |
157 | #### nodemailer
158 |
159 | 非常方便从你的Node.js发送email
160 |
161 | #### nodemailer-smtp-transport
162 |
163 | 基于nodemailer,使用SMTP传输
164 |
165 | #### passport
166 |
167 | 社交媒体的认证,github之类
168 |
169 | #### pm2
170 |
171 | 生产应用进程管理器for Node.js 应用,内置负载均衡
172 |
173 | #### qn
174 |
175 | 七牛api客户端
176 |
177 | #### ready
178 |
179 | 混入题那几一次性ready一次性时间回调处理
180 |
181 | #### request
182 |
183 | 简化的http请求客户端,用户量比superagent大,而且支持流操作pipe,更强大
184 |
185 | #### response-time
186 |
187 | 这个模块创建一个中间件取记录请求在HTTP服务中的相应时间,这个相应时间是从一个请求进入这个中间件到头部被创建并出客户端的时间
188 |
189 | #### superagent
190 | 服务端的http请求
191 |
192 | #### utility
193 |
194 | 有用的工具集合
195 | md5,sha1,sha256,hamc,decode & encode,getParamNames,randomString,has,noop,Date utils,Number utils,Timers and more
196 |
197 | #### validator
198 |
199 | 字符串验证器,消毒器,有node端,还有浏览器端
200 | 主要是正则匹配是不是符合要求的字符串
201 |
202 | #### xmlbuilder
203 |
204 | 一个xml构造器,类似于java-xmlbuilder
205 |
206 | #### xss
207 |
208 | 根据白名单过滤HTML,防止xss攻击,通过白名单中来控制允许的标签和相关的标签属性,提供一系列接口以供拓展
209 |
210 |
--------------------------------------------------------------------------------
/webpack.config.js:
--------------------------------------------------------------------------------
1 | var path = require('path');
2 | //nodejs 中 path对象用于处理目录对象,提高开发效率
3 | //模块导入
4 |
5 | module.exports = {
6 | //入口文件
7 | entry : './src/main.js',
8 | //输出
9 | output : {
10 | //文件地址,使用绝对path.join绝对路径
11 | path : path.join(__dirname, './dist'),
12 | //[name]这里是webpack根据路口文件自动生成的名字
13 | filename : '[name].js',
14 | //公共文件生成的地址
15 | publicPath : '/dist/'
16 | },
17 | //服务器相关,自动刷新
18 | devServer : {
19 | //Set this as true if you want to access dev server from arbitrary url.
20 | // This is handy if you are using a html5 router.
21 | historyApiFallback : false,
22 | //hot module replacement 模块热替换,无需刷新整个页面,把改变的部分替换
23 | hot : false,
24 | //支持iframe模式和inline模式
25 | inline : true,
26 | //进度条
27 | progress : true
28 | },
29 | //加载器
30 | module : {
31 | loaders : [
32 | //解析vue文件
33 | {test : /\.vue$/, loader : 'vue-loader'},
34 | //转化ES6语法
35 | {test : /\.js$/, loader : 'babel-loader', exclude : /node_modules/},
36 | //编译css并自动添加css前缀
37 | {test : /\.css$/, loader : 'style-loader!autoprefixer-loader!css-loader'},
38 | //.scss文件编译
39 | //需要css-loader,style-loader,sass-loader,node-sass,
40 | {test : /\.scss$/, loader : 'css-loader!style-loader!sass-loader!node-sass'},
41 | //图片转化,小于8k的图片转化为base64编码的
42 | {test : /\.(png|jpg|gif)$/, loader : 'url-loader?limit=8192'},
43 | //html模板编译
44 | {test : /\.(html|tpl)$/, loader : 'html-loader'}
45 | ]
46 | },
47 | //.vue的配置
48 | vue : {
49 | loaders : {
50 | css : 'style-loader!autoprefixer-loader'
51 | }
52 | },
53 | //转化为ES5语法
54 | babel : {
55 | presets : ['es2015'],
56 | //合聚代码,不污染区全局
57 | plugins : ['transform-runtime']
58 | },
59 | reslove : {
60 | //require时省略的扩展名
61 | extensions : ['','.js','.vue'],
62 | //别名,可以直接使用别名来代表设定的路径
63 | alias : {
64 | filter : path.join(__dirname, './src/filters'),
65 | components : path.join(__dirname, './src/components')
66 | }
67 | },
68 | //开启source-map
69 | devtool : 'eval-source-map'
70 | };
71 |
--------------------------------------------------------------------------------
/代码规范.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
323 |
Web API 设计规范
324 |
325 | 目录
326 |
327 |
328 | - 1 动机
329 | - 2 一致性
330 | -
331 | 3 通用格式约定
332 |
333 | -
334 | 3.1 HTTP 头定义
335 |
336 | - 3.1.1 Content-Type
337 | - 3.1.2 CORS
338 |
339 |
340 | -
341 | 3.2 数据格式
342 |
343 | - 3.2.1 JSON
344 | - 3.2.2 日期时间
345 | - 3.2.3 文件
346 |
347 |
348 |
349 |
350 | -
351 | 4 RESTful 部分
352 |
353 | -
354 | 4.1 列表操作
355 |
356 | - 4.1.1 获取列表
357 | - 4.1.2 操作列表内的资源
358 | - 4.1.3 删除列表内的资源
359 | - 4.1.4 创建资源到列表
360 | - 4.1.5 获取列表额外信息
361 | - 4.1.6 列表事务处理
362 |
363 |
364 | -
365 | 4.2 资源操作
366 |
367 | - 4.2.1 获取资源
368 | - 4.2.2 更新资源
369 | - 4.2.3 修改资源
370 | - 4.2.4 获取资源额外信息
371 | - 4.2.5 资源事务处理
372 |
373 |
374 |
375 |
376 | -
377 | 5 非 RESTful 部分
378 |
379 | -
380 | 5.1 会话
381 |
382 | -
383 | 5.1.1 会话操作
384 |
385 |
386 |
387 |
388 |
389 |
390 |
391 | 1 动机
392 |
393 | 现代 Web 项目的部署一般是前后端分离,Web API 和 Web Resource 单独部署,开发人员也分为前端开发和后端开发。
394 | 为了减少前后端开发沟通 Web API 的成本,并增强 Web API 的可读性、可维护性,提供了这么一套规范,遵循这套规范可以在 HTTP 到前端的处理上做到一定程度的优化。
395 |
396 | 2 一致性
397 |
398 | 这份规范中的示例 URL 中,使用冒号「:」开头的路径都表示一个通用的名称,具体实现可以使用自己希望的名称来定义。
399 |
400 | 这份规范中的示例片段使用了 HTTP/1.1 的报文格式,具体实现可以使用 HTTP 的其它版本。
401 |
402 | 3 通用格式约定
403 |
404 | 3.1 HTTP 头定义
405 |
406 | 3.1.1 Content-Type
407 |
408 | 在这套 API 规范中,所有请求和响应的实体部分都根据头中描述的 Content-Type
来解析,如果没有设置默认以 application/json
来解析。
409 |
410 |
411 | 前端应该根据 Content-Type
来解析后端的响应。因为后端的响应往往会被中间层或代理层破坏,无法确保 Content-Type
总是 application/json
。
412 |
413 |
414 | 3.1.2 CORS
415 |
416 | 前后端部署分离的项目前端通常会跨域调用 API,所以 API 上需要加上跨域调用的支持。
417 |
418 | 这套规范会涉及到以下这些 CORS 相关的响应头,如果有跨域需求建议给所有 API 都带上。
419 |
420 |
421 | -
422 |
Access-Control-Allow-Origin
423 | 这个头的取值和请求头中的 Origin
保持一致(如果请求头中没有 Origin
就不需要这个响应头)。
424 | 后端应该判断 Origin
是不是一个可信赖的源,如果不是应该响应 403
状态码拒绝访问。
425 |
426 | Access-Control-Allow-Method
: OPTION
, GET
, POST
, PUT
, PATCH
, DELETE
427 | Access-Control-Allow-Headers
: Content-Type
428 | Access-Control-Allow-Credentials
: true
429 |
430 |
431 | 此外,所有带 POST
请求的 API 都应该同时支持 OPTIONS
请求。并且 OPTIONS
请求不处理任何业务逻辑,只是带着上面列出的响应头直接响应。
432 |
433 |
434 | 这些是浏览器行为,是跨域部署必须的,具体可以参考
W3C CORS 规范。
435 |
436 |
437 | 3.2 数据类型
438 |
439 | 3.2.1 JSON
440 |
441 | 这套规范中,数据类型都是基于 JSON 描述的,JSON 支持的数据类型有以下这些:
442 |
443 |
444 | Number
445 | String
446 | Boolean
447 | Object
448 | Array
449 | Null
450 |
451 |
452 | 需要注意的是,由于前端是 JavaScript,Number
类型对应的实际上是 64 位的 IEEE754 浮点数。
453 | 所以,它能精确描述的整数范围是从 -9007199254740991 到 9007199254740991,这意味着无法支持 int 64 这样的超大整型,这种情况下请使用字符串传输。
454 |
455 | 3.2.2 日期时间
456 |
457 | 在这套规范中,日期时间类型推荐使用 ISO 8601(见 RFC 3339 中的 date-time
定义) 的标准日期时间格式传输。
458 |
459 |
460 | 2016-05-17T17:24:41.324Z
461 | 或者
462 | 2016-05-18T01:24:41.324+08:00
463 |
464 |
465 | 这是为了避免直接使用 YYYY-MM-DD 格式时遇到客户端时区不正确造成解析错误的问题,
466 |
467 | 3.3.3 文件
468 |
469 | 文件传输的 API 设计比较特殊,如果使用 FormData,建议对「文件上传」这件事情开发单独的接口,不带其它参数,专注传文件。
470 |
471 |
472 | 因为 FormData 中的其它数据是没有类型的,只能区分文件和非文件。
473 |
474 |
475 | 如果希望在一个复杂的请求实体中加上文件,可以将文件转换成 Data URL(RFC 2397)格式,作为 JSON 中的字符串格式传输。
476 |
477 | 比如一个 html 文件的内容是:
478 |
479 | <h1>test</h1>
480 |
481 |
482 | 那么它可以被转换成一个这样的字符串传输
483 |
484 | data:text/html;base64,PGgxPnRlc3Q8L2gxPg==
485 |
486 |
487 |
488 | 对于纯文本的数据转换 Data URL,直接 encodeURIComponent 即可,base64 不是必须的。
489 |
490 |
491 |
492 | 3.4 异常处理
493 |
494 | 3.4.1 状态码
495 |
496 | 这套 API 使用 HTTP 状态码描述响应的基本状态,这样可以使用通用的监控和报警服务处理 API。
497 |
498 | 对于一个来自请求的异常,服务器应该响应 4xx 状态码,比如请求的参数类型错误、资源找不到等。这些问题都是可以通过排查解决的,比如改正请求的参数格式等。大部分时候 4xx 错误都是在开发阶段解决的。
499 |
500 | 5xx 状态码表示服务内部错误,比如数据库查询超时、依赖的其它服务给了错误的响应。这类错误通常是运行时产生的。
501 |
502 |
503 | 这套 API 并不强制约定所有的状态码都必须完全符合 HTTP 的定义,但底线是状态码的第一位数必须符合语义。
504 |
505 |
506 | 所有的异常响应,其内容都是一个固定格式的 JSON 数据,比如
507 |
508 | HTTP/1.1 500 Internal Server Error
509 |
510 | {
511 | "name": "UNKNOWN_SERVER_ERROR",
512 | "message": "服务器未知错误"
513 | }
514 |
515 |
516 | HTTP/1.1 404 Not Found
517 |
518 | {
519 | "name": "RESOURCE_NOT_FOUND",
520 | "message": "资源未找到"
521 | }
522 |
523 |
524 |
525 | 这个响应中的 name 和 message 是必须的,实现可以自己扩展一些其它数据。
526 |
527 |
528 | 4 RESTful 部分
529 |
530 | REST 风格的 API 将所有东西都视为资源(可以理解为文件)和列表(可以理解为目录)。
531 |
532 |
533 | 4.1 列表操作
534 |
535 |
536 | 列表通常以名词的复数形式或者复数性质的词来命名,比如 comments、xxxlist。这样可以更容易地区分开列表和普通资源。
537 |
538 |
539 | 4.1.1 获取列表
540 |
541 |
542 | 使用 GET
方法,来获取一个列表。
543 |
544 |
545 | GET /:list?limit=2 HTTP/1.1
546 |
547 | HTTP/1.1 200 OK
548 |
549 | [
550 | {
551 | "id": 1,
552 | "name": "value1",
553 | "field2": "value2",
554 | "field3": "value3"
555 | },
556 | {
557 | "id": 2,
558 | "field1": "value1",
559 | "field2": "value2",
560 | "field3": "value3"
561 | }
562 | ]
563 |
564 |
565 |
566 | 列表中的每个记录必须有唯一的 id 字段(虽然上面的例子中 id 是数值,实际上可以是任何类型),其它字段都是可选的,由具体接口文档定义。
567 |
568 |
569 |
570 | 4.1.2 操作列表内的资源
571 |
572 | 列表可以视为一个目录,这个目录中包含了若干以 id 命名的文件。访问列表资源可以在列表后面加上资源 id 即可。
573 |
574 | 比如获取列表内的某个资源可以这么做
575 |
576 | GET /:list/:id HTTP/1.1
577 |
578 | 对列表内的资源操作和普通的资源操作一样,可以参考「4.2. 资源」。
579 |
580 |
581 |
582 | 4.1.3 删除列表内的资源
583 |
584 | 删除列表内的资源可以针对资源的 URL 直接使用 DELETE
方法操作。
585 |
586 | DELETE /:list/:id HTTP/1.1
587 |
588 | HTTP/1.1 204 No Content
589 |
590 |
591 | 4.1.4 创建资源到列表
592 |
593 | 标准的资源创建可以直接对列表做 POST
操作,并带资源的所有数据,类似「4.2.1 更新资源」的操作,只不过不需要指定 id。
594 |
595 | POST /:list HTTP/1.1
596 |
597 | {
598 | "field1": "value1",
599 | "field2": "value2",
600 | "field3": "value3",
601 | "field4": "value4"
602 | }
603 |
604 |
605 | 创建资源后可以直接响应这个资源的相关信息,建议响应 id。
606 |
607 | HTTP/1.1 200 OK
608 |
609 | {
610 | "id": 123
611 | }
612 |
613 |
614 | 也可以响应一个 303
重定向,让客户端转而请求这个创建后的资源。
615 |
616 | HTTP/1.1 303 See Other
617 | Location: /:list/123
618 |
619 | 客户端遇到 303
状态码后会自动向 Location
指定的 URI 发起 GET
请求。
620 |
621 | 使用 303 来响应 POST 会造成一次多余的 HTTP 请求,而且如果资源中不包含 id 的话前端获取资源 id 会比较麻烦。
622 |
623 |
624 | 4.1.5 获取列表额外信息
625 |
626 | 列表除了列表项之外可能还包含一些额外信息,比如列表总长度、列表最后更新时间等。
627 |
628 |
如果视列表为一个目录的话,我们将这些额外的信息视为目录下除了标准列表项外的其它资源,使用和资源一样的方式操作。
629 |
630 |
GET /:list/:resource HTTP/1.1
631 |
632 |
633 | 具体参考「4.2 资源操作」。
634 |
635 | 额外信息也可以是一个列表。
636 |
637 | GET /:list/:sublist HTTP/1.1
638 |
639 |
640 | 具体参考「4.1 列表操作」。
641 |
642 |
643 | 这些信息的名称定义可能和列表内的资源 id 或事务名冲突,建议在 id 的定义规则上避免这样的冲突,比如使用数值或 hash 作为 id,使用名词作为额外资源名,使用动词或动名词作为事务名。
644 |
645 |
646 | 4.1.6 列表事务处理
647 |
648 | 有些列表除了资源操作外还有一些非常复杂的操作,我们认为这是一种事务。比如「下单」这样的操作肯定不是简单地创建一个「订单」资源,它还会做修改库存、修改账户余额等一系列操作,它就是一个事务。
649 |
650 |
对于这种事务级别的操作,我们统一使用 POST
方法,并把事务名「像资源一样」写在列表的后面,可以理解为向服务器发起某种操作请求。
651 |
652 |
POST /:list/:action HTTP/1.1
653 |
654 |
655 | 对于事务级别的操作,这份规范对其相应的内容不做约束,由具体的文档来说明。
656 |
657 |
658 | 4.2 资源操作
659 |
660 | 4.2.1 获取资源
661 |
662 | 所有资源都可以通过 GET
方法来获取其内容。
663 |
664 | GET /:resource HTTP/1.1
665 |
666 |
667 | HTTP/1.1 200 OK
668 |
669 | {
670 | "field1": "value1",
671 | "field2": "value2",
672 | "field3": "value3",
673 | "field4": "value4"
674 | }
675 |
676 |
677 |
678 | 4.2.2 更新资源
679 |
680 | 可以将 PUT
视为是 GET
的一个逆操作。
681 |
682 | PUT /:resource HTTP/1.1
683 |
684 | {
685 | "field1": "value1",
686 | "field2": "new value",
687 | "field3": "value3",
688 | "field4": "value4"
689 | }
690 |
691 |
692 | HTTP/1.1 204 No Content
693 |
694 | 这里的 :resource 只能是一个资源,不能是列表(列表是没有 PUT 方法的)。比如更新一个全局资源:
695 |
696 | PUT /config HTTP/1.1
697 |
698 | {}
699 |
700 |
701 | 也可能是一个列表项
702 |
703 | PUT /mylist/123 HTTP/1.1
704 |
705 | {}
706 |
707 |
708 |
709 | 请求实体的结构与「获取资源」完全保持一致,即使某个字段的值没有改变也带上原来的值。
710 |
711 |
712 | 4.2.3 修改资源
713 |
714 | PUT
方法是对整个资源的更新,如果希望只对资源的某一部分做更新操作可以使用 PATCH
方法。
715 |
716 | PATCH /:resource HTTP/1.1
717 |
718 | {
719 | "field3": "new value"
720 | }
721 |
722 |
723 | HTTP/1.1 204 No Content
724 |
725 |
726 |
727 | - 只针对请求实体中有带上的字段做修改
728 |
729 |
730 |
731 | 这里的 :resource 只能是一个资源,不能是列表(列表是没有 PATCH 方法的)。比如修改一个全局资源:
732 |
733 | PATCH /config HTTP/1.1
734 |
735 | { "banner": true }
736 |
737 |
738 | 也可能是一个列表项
739 |
740 | PATCH /mylist/123 HTTP/1.1
741 |
742 | { "name": "hehe" }
743 |
744 |
745 | 4.2.4 获取资源额外信息
746 |
747 | 资源除了自己的信息外还可以提供额外信息,这种情况下我们将这个资源本身视为一个目录,具体操作可以参考「4.1.5 获取列表额外信息」。
748 |
749 | 4.2.5 资源事务处理
750 |
751 | 资源也可以有相关的事务,比如「取消订单」这个操作不仅仅是一个「修改订单状态」那么简单,可能还会有修改库存、修改用户余额等操作,它实际上就是一个事务。
752 |
753 | 对于资源的事务处理的细则,可以参考「4.1.6 列表事务处理」。
754 |
755 |
756 | 5 非 RESTful 部分
757 |
758 | 5.1 会话
759 |
760 | 由于会话通常关联一些敏感信息,暴露给前端就可能出现安全问题。这份规范中通过 HTTP Only 的 Cookie 来处理会话。并且所有与会话有关的操作都放在一个 :session 目录下,或者如果有条件的话可以使用一个独立的域名来部署。
761 |
762 | GET /:session HTTP/1.1
763 |
764 | {
765 | "username": "hehe"
766 | }
767 |
768 |
769 |
770 | 所谓会话就是用户相关的东西,比如获取用户信息、登陆等。
771 |
772 |
773 | 5.1.1 会话操作
774 |
775 | 会话本身可以视为一个资源,可以作为资源操作,具体参考「4.2. 资源」。
776 |
777 | 比如一个具体的登录接口可能这么设计:
778 |
779 | POST /user/login HTTP/1.1
780 |
781 | {
782 | "username": "hehe",
783 | "password": "***"
784 | }
785 |
786 |
787 | 引用
788 |
789 |
795 |
--------------------------------------------------------------------------------
/作用域.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mrwaite/Share/e0cbf85a1790eb396f09cc735c262c22037303e9/作用域.png
--------------------------------------------------------------------------------
/回调地狱.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mrwaite/Share/e0cbf85a1790eb396f09cc735c262c22037303e9/回调地狱.jpg
--------------------------------------------------------------------------------
/基于大数据的音乐推荐及展示云平台-陈威特.doc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mrwaite/Share/e0cbf85a1790eb396f09cc735c262c22037303e9/基于大数据的音乐推荐及展示云平台-陈威特.doc
--------------------------------------------------------------------------------
/基本类型转化.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mrwaite/Share/e0cbf85a1790eb396f09cc735c262c22037303e9/基本类型转化.png
--------------------------------------------------------------------------------
/大一暑假计划方案一.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mrwaite/Share/e0cbf85a1790eb396f09cc735c262c22037303e9/大一暑假计划方案一.md
--------------------------------------------------------------------------------
/技术社区需求.md:
--------------------------------------------------------------------------------
1 | ## 技术社区需求
2 |
3 | ### 项目描述:
4 |
5 | 完成之后搭建在协会的内网,用于协会成员日常的技术文章的分享
6 |
7 | ### 模块分析
8 |
9 | #### 用户界面
10 |
11 | 1. **注册 && 登陆模块**
12 | > 提供协会成员和外部人员的注册与登陆。
13 |
14 | 2. **发布文章模块**
15 | > 提供已注册人员的文章发布的模块
16 |
17 | 3. **文章展示模块**
18 | > 提供成员已发布文章的展示模块,且每一个已注册的成员可以在浏览文章的时候给文章点赞
19 |
20 | 4. **排行榜模块**
21 | > 展示所有已注册成员发布的所有文章获得的所有赞的总和,以排行榜的形式,可以只罗列前五名
22 |
23 | #### 管理界面
24 |
25 | 1. **登陆界面**
26 | > 登陆到后台的管理界面
27 |
28 | 2. **已注册成员罗列**
29 | > 罗列已注册成员列表,并在后面加上统计此成员的文章的总数目
30 |
31 | 3. **指定成员的文章列表**
32 | > 上面罗列成员之后,点击相应的成员,可以获得此成员的文章列表,管理员可以删除此文章
33 |
34 | ### 其他需求
35 |
36 | 1. 后端与前端分离
37 | 2. 使用数据库存储数据
38 | 3. 注意代码编写的规范
39 | 4. 注意变量命名的语义化---与功能相匹配
40 | 5. 注意代码注释量
41 | 6. 前后端交互用ajax完成
42 | 7. 利用 Github 进行任务的协作,版本的迭代
43 | 8. 前端的同学考虑到浏览器的差异
44 | 9. 后端的同学考虑到安全方面的问题
45 |
46 | **参考网站:**
47 | [segmentfault][1]
48 | [知乎][2]
49 |
50 | **参考资料**
51 | [JavaScript代码规范][3]
52 |
53 |
54 | [1]: https://segmentfault.com/
55 | [2]: https://www.zhihu.com/
56 | [3]: https://github.com/ecomfe/spec/blob/master/javascript-style-guide.md
57 |
--------------------------------------------------------------------------------
/软件备忘.md:
--------------------------------------------------------------------------------
1 | oh-my-zsh
2 | supervisor
3 | node-inspector
4 | browser-sync
5 | docky
6 | gitbook
7 | webstorm
8 | filezila
9 | wps
10 | keepass
11 | deloge
12 | dropbox
13 | postman
14 | pocket
15 |
16 |
--------------------------------------------------------------------------------
/闭包的解释.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mrwaite/Share/e0cbf85a1790eb396f09cc735c262c22037303e9/闭包的解释.png
--------------------------------------------------------------------------------