- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我使用以下设置使用 apache 构建了一个转发代理服务器:
<VirtualHost *:8088>
ServerAdmin test@gmail.com
DocumentRoot "E:/test"
ServerName www.test.com
ServerAlias test.com
ErrorLog "logs/test.com-error.log"
CustomLog "logs/test.com-access.log" common
<Directory "E:/test">
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
ProxyRequests On
ProxyVia Off
ProxyTimeout 10
<Proxy *>
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Proxy>
</VirtualHost>
主机文件
127.0.0.1 localhost
然后我用curl测试代理服务器
curl.exe -v https://www.google.com.hk -x localhost:8088
输出
* About to connect() to proxy localhost port 8088 (#0)
* Trying 127.0.0.1... connected
* Connected to localhost (127.0.0.1) port 8088 (#0)
* Establish HTTP proxy tunnel to www.google.com.hk:443
> CONNECT www.google.com.hk:443 HTTP/1.1
> Host: www.google.com.hk:443
> User-Agent: curl/7.21.7 (amd64-pc-win32) libcurl/7.21.7 OpenSSL/0.9.8r zlib/1.
2.5
> Proxy-Connection: Keep-Alive
>
< HTTP/1.0 200 Connection Established
< Proxy-agent: Apache/2.2.25 (Win32) PHP/5.4.21
<
* Proxy replied OK to CONNECT request
* successfully set certificate verify locations:
* CAfile: D:\curl-ssl\curl-ca-bundle.crt
CApath: none
* SSLv3, TLS handshake, Client hello (1):
* SSLv3, TLS handshake, Server hello (2):
* SSLv3, TLS handshake, CERT (11):
* SSLv3, TLS handshake, Server finished (14):
* SSLv3, TLS handshake, Client key exchange (16):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSL connection using RC4-SHA
* Server certificate:
* subject: C=US; ST=California; L=Mountain View; O=Google Inc; CN=*.googl
e.com.hk
* start date: 2013-11-20 14:47:22 GMT
* expire date: 2014-03-20 00:00:00 GMT
* subjectAltName: www.google.com.hk matched
* issuer: C=US; O=Google Inc; CN=Google Internet Authority G2
* SSL certificate verify ok.
> GET / HTTP/1.1
> User-Agent: curl/7.21.7 (amd64-pc-win32) libcurl/7.21.7 OpenSSL/0.9.8r zlib/1.
2.5
> Host: www.google.com.hk
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Thu, 05 Dec 2013 02:21:27 GMT
< Expires: -1
< Cache-Control: private, max-age=0
< Content-Type: text/html; charset=Big5
< Set-Cookie: PREF=ID=12cdbbbf43c234b5:FF=0:NW=1:TM=1386210087:LM=1386210087:S=B
HZ4WAj3fqZicDa_; expires=Sat, 05-Dec-2015 02:21:27 GMT; path=/; domain=.google.c
om.hk
< Set-Cookie: NID=67=EvwPZiG49GZO1AMLw7cTY1Azrqzb77uTpCUv9rOECEJh4PRB523yMIJm8L5
OxxWBeq44qM-Dn8xYUijDmBrvXfL504U4_FSunEfG5UUIDveWbHG2BirORx5Jqk9MVFkd; expires=F
ri, 06-Jun-2014 02:21:27 GMT; path=/; domain=.google.com.hk; HttpOnly
< P3P: CP="This is not a P3P policy! See http://www.google.com/support/accounts/
bin/answer.py?hl=en&answer=151657 for more info."
< Server: gws
< X-XSS-Protection: 1; mode=block
< X-Frame-Options: SAMEORIGIN
< Alternate-Protocol: 443:quic
< Transfer-Encoding: chunked
<
... The google home page HTML ...
我认为 https 代理流程是:
向代理服务器发送 CONNECT http 请求
代理服务器将此 CONNECT 请求转发到 www.google.com.hk:443
www.google.com.hk:443 向代理服务器返回 200 Connection Establish 响应
代理服务器将响应转发给 curl
curl 开始向代理服务器发送 tls 握手数据报(可能是加密的?)
代理服务器对数据报一无所知,因为数据报是加密的,代理服务器只是使用之前发送 CONNECT 请求的套接字将此数据报转发到 www.google.com.hk:443。
www.google.com.hk:443 发送加密的tls握手数据报给代理服务器
代理服务器将加密数据转发给curl而不解密
...经过多次握手,握手结束,开始发送GET请求
curl 向代理服务器发送 GET 请求,此请求数据报已加密
代理服务器使用上述套接字将加密后的数据报转发到 www.google.com.hk:443
www.google.com.hk:443 返回加密响应
代理服务器将响应转发给 curl
curl 解密响应并显示 html
不知道我的理解对不对,尤其是在STEP 3之后,curl收到了200 CONNECTION ESTABLISHED的响应。
我想知道代理服务器在收到200 CONNECTION ESTABLISHED响应后做了什么,代理是否解密了请求数据报?
最佳答案
HTTPS 代理可以连接到任何远程资源。如果它连接到 HTTPS 服务器,它不会看到 200 响应,因为响应是加密的。
一般来说,CONNECT 动词的意思是“建立一个不透明的隧道,并在它准备好时告诉我”。观点。所以服务器通过连接到远程服务器从字面上建立一个隧道,一旦建立连接,代理就会向客户端发送肯定的响应。之后客户端可以向代理发送任何内容,代理将简单地将数据中继到远程服务器,从服务器中挑选数据并将其发送回客户端。
这种方案允许使用 HTTPS 代理连接到任何类型的服务器,而不仅仅是 HTTP/HTTPS。
关于http - 代理服务器在代理https请求时做了什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20390369/
我有一个关于 JavaScript 语法的问题。实际上,我在自学 MEAN 堆栈教程时想出了编码(https://thinkster.io/mean-stack-tutorial#adding-aut
在我的书中它使用了这样的东西: for($ARGV[0]) { Expression && do { print "..."; last; }; ... } for 循环不完整吗?另外,do 的意义何
我已经编写了读取开关状态的代码,如果按 3 次 # 则退出。 void allkeypadTest(void) { static uint8_t modeKeyCount=0; do
因此,对于上周我必须做的作业,我必须使用 4 个 do-while 循环和 if 语句在 Java 中制作一个猜谜游戏。我无法成功完成它,类(class)已经继续,没有为我提供任何帮助。如果有人可以查
int i=1,j=0,n=10,k; do{ j+=i; i<<1; printf("%d\n",i); // printf("%d\n",12<<1); }while
此代码用于基本杂货计算器的按钮。当我按下按钮时,一个输入对话框会显示您输入商品价格的位置。我遇到的问题是我无法弄清楚如何获得 do ... while 循环以使输入对话框在输入后弹出。 我希望它始终恢
当我在循环中修改字符串或另一个变量时,它的条件是否每次都重新计算?或者在循环开始前一次 std::string a("aa"); do { a = "aaaa"; } while(a.size<10)
我刚刚写了这个,但我找不到问题。我使用代码块并编写了这个问题 error: expected 'while' before '{' token === Build finished: 1 errors
do { printf("Enter number (0-6): ", ""); scanf("%d", &Num); }while(Num >= 0 && Num 表示“超过”,<表
我有一个包含 10 个项目的 vector (为简单起见,所有项目都属于同一类,称其为“a”)。我想要做的是检查“A”不是 a) 隐藏墙壁或 b) 隐藏另一个“A”。我有一个碰撞函数可以做到这一点。
嗨,这是我的第二个问题。我有下表 |-----|-------|------|------| |._id.|..INFO.|.DONE.|.LAST.| |..1..|...A...|...N..|.
这个问题在这里已经有了答案: 关闭 12 年前。 Possible Duplicates: Why are there sometimes meaningless do/while and if/e
来自 wikibook在 F# 上有一小部分它说: What does let! do?# let! runs an async object on its own thread, then it i
我在 Real World Haskell 书中遇到了以下函数: namesMatching pat | not (isPattern pat) = do exists do
我有一个类似于下面的用例,我创建了多个图并使用 gridExtra 将它们排列到一些页面布局中,最后使用 ggsave 将其保存为 PDF : p1 % mutate(label2
当我使用具有 for 循环的嵌套 let 语句时,如果没有 (do (html5 ..)),我将无法运行内部 [:tr]。 (defpartial column-settings-layout [&
执行 vagrant up 时出现此错误: anr@anr-Lenovo-G505s ~ $ vagrant up Bringing machine 'default' up with 'virtua
# ################################################# # Subroutine to add data to the table Blas
我想创建一个检查特定日期格式的读取主机。此外,目标是检查用户输入是否正确,如果不正确,则提示应再次弹出。 当我刚接触编程时,发现了这段代码,这似乎很合适。我仍然在努力“直到” do {
我关注这个tutorial在谷歌云机器学习引擎上进行培训。我一步一步地跟着它,但是在将 ml 作业提交到云时我遇到了错误。我运行了这个命令。 sam@sam-VirtualBox:~/models/r
我是一名优秀的程序员,十分优秀!