使用生成免费证书 https://letsencrypt.org/
yum install python2-certbot-nginx
certbot --nginx --niginx-server-root <your_nginx_install_path> -d <your_domains>
注意: 两个参数 nginx 安装路径 和 真实域名,另外该命令会将配置写到 nginx 配置中
const mysql = require('mysql2') | |
const tunnel = require('tunnel-ssh') | |
const ssh2mysql = { | |
_conn: null, | |
_mysql_pool: null, | |
/** | |
* @param obj sshConfig SSH Configuration as defined by ssh2 package |
import * as mysql from 'mysql2' | |
const Client = require('ssh2').Client | |
const ssh2mysql = { | |
_conn: null, | |
_mysql_conn: null, | |
/** | |
* @param obj sshConfig SSH Configuration as defined by ssh2 package |
axios({ | |
url: 'http://localhost:5000/static/example.pdf', | |
method: 'GET', | |
responseType: 'blob', // important | |
}).then((response) => { | |
const url = window.URL.createObjectURL(new Blob([response.data])); | |
const link = document.createElement('a'); | |
link.href = url; | |
link.setAttribute('download', 'file.pdf'); | |
document.body.appendChild(link); |
#!/bin/bash | |
# Install Shadowsocks on CentOS 7 | |
echo "Installing Shadowsocks..." | |
random-string() | |
{ | |
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w ${1:-32} | head -n 1 | |
} |
#!/bin/sh | |
# create self-signed server certificate: | |
read -p "Enter your domain [www.example.com]: " DOMAIN | |
echo "Create server key..." | |
openssl genrsa -des3 -out $DOMAIN.key 1024 |
yum install python2-certbot-nginx
certbot --nginx --niginx-server-root <your_nginx_install_path> -d <your_domains>
注意: 两个参数 nginx 安装路径 和 真实域名,另外该命令会将配置写到 nginx 配置中
HTTP/2 抓包
使用 TLS/SSL 加密,都是随着连接生成有变化的(???)
Mac 下
$ export SSLKEYLOGFILE=/Users/username/sslkeylogs/output.log
$ open -a Google\ Chrome
打开 wireshark
import * as React from 'react' | |
import styled from 'styled-components' | |
import { observable } from 'mobx' | |
import { Tooltip, Input, message } from 'antd' | |
import { Icon } from '@/components' | |
import { observer } from 'mobx-react' | |
// 匹配非字母数字下划线空格中文的字符 | |
const reg = /[^a-zA-Z0-9_\s\u4e00-\u9fa5]/g |