'work-log-2018年9月20日'

npm使用总结

  1. 当你准备发布你的包到npmjs时,首先得npm login(只需一次).
  2. 当你执行npm publish 时,不妨先执行 npm pack ,看看打包出来的dist文件是否和预期一样。
  3. 当你因为某个错误的操作,导致把一些错误的东西发布到npmjs(比如说我),这个时候你莫慌.只需把错误的版本设置为deprecate,使用命令 npm deprecate <pkg>[@<version>] <message>
npm deprecate test@0.0.1 "此版本作废"

nginx配置Websocket代理 + SSL

http{

server{

listen 443 ssl;
server_name ws.yourdomain.com;
ssl_certificate /opt/cert/s.crt;//RSA public key
ssl_certificate_key /opt/cert/s.key;//RSA private key
ssl_session_cache shared:SSL:1m;
ssl_protocols SSLv2 SSLv3 TLSv1;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP;
ssl_prefer_server_ciphers on;

location /websocket {
proxy_pass http://127.0.0.1:8081;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
}
}
}

参考

https://www.cnblogs.com/penghuwan/p/6973702.html

http://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_certificate

http://nginx.org/en/docs/http/websocket.html