Skip to content

Commit ea45e2b

Browse files
committed
Merge pull request waylau#6 from skyleft/master
Testing the Applicatio 和 11.4 Summary 勘误
2 parents 9675782 + 307f0f3 commit ea45e2b

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

NETTY BY EXAMPLE/11.4 Summary.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
总结
22
====
33

4-
在本章中,我们学习了如何使用 Netty 中的 WebSocket 来实现管理
5-
Web 应用程序的实时数据。我们讲了所支持的数据类型,并讨论了你可能会遇到的问题。虽然 WebSockets 并不能在所有情况下使用,但应该清楚,它代表在 web 技术的一个重要进展
4+
在本章中,我们学习了如何使用 Netty 中的 WebSocket 来管理
5+
Web 应用程序中的实时数据。我们讲了所支持的数据类型,并讨论了你可能会遇到的问题。虽然 WebSockets 并不能在所有情况下使用,但应该清楚,它代表了 web 技术发展上的一个重要进步
66

7-
接下来我们来谈谈另一个发展“Web2.0”也许你还没有听说过“SPDY”,但一旦您已经阅读下一章,你很可能会使用它在你的下一个应用程序
7+
接下来我们来谈谈“Web2.0”开发中的另一项技术。也许你还没有听说过“SPDY”,但只要你读了下一章,你就很可能在你将来的开发中很好的运用这门技术了

NETTY BY EXAMPLE/Testing the Application.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
mvn -PChatServer -Dport=1111 clean package exec:exec
1111

12-
下面是控制台的输出
12+
下面是控制台的主要输出(删除了部分行)
1313

1414
Listing 11.5 Compile and start the ChatServer
1515

@@ -26,17 +26,17 @@ Listing 11.5 Compile and start the ChatServer
2626
[INFO] --- exec-maven-plugin:1.2.1:exec (default-cli) @ chat-server ---
2727
Starting ChatServer on port 9999
2828

29-
可以在浏览器中通过 http://localhost:9999 地址访问程序
29+
可以在浏览器中通过 http://localhost:9999 地址访问程序。图11.5展示了此程序在Chrome浏览器下的用户界面。
3030

3131
Figure 11.5 WebSockets ChatServer demonstration
3232

3333
![](../images/Figure 11.5 WebSockets ChatServer demonstration.jpg)
3434

35-
图中显示了两个客户端可以交互了
36-
35+
图中显示了两个已经连接了的客户端。第一个客户端是通过上面的图形界面连接的,第二个是通过Chrome浏览器底部的命令行连接的
36+
你可以注意到,这两个客户端都在发送消息,每条消息都会显示在两个客户端上。
3737
###如何加密?
3838

39-
通过添加 SslHandler 到 ChannelPipeline 来配置加密。如下:
39+
在实际场景中,加密是必不可少的。在Netty中实现加密并不麻烦,你只需要向 ChannelPipeline 中添加 SslHandler ,然后配置一下即可。如下:
4040

4141
Listing 11.6 Add encryption to the ChannelPipeline
4242

@@ -59,7 +59,7 @@ Listing 11.6 Add encryption to the ChannelPipeline
5959

6060
1.扩展 ChatServerInitializer 来实现加密
6161

62-
2.SslHandler 到 ChannelPipeline
62+
2.ChannelPipeline 中添加SslHandler
6363

6464
最后修改 ChatServer,使用 SecureChatServerInitializer 并传入 SSLContext
6565

@@ -101,9 +101,9 @@ Listing 11.7 Add encryption to the ChatServer
101101

102102
1.扩展 ChatServer
103103

104-
2.返回先前创建的 SecureChatServerInitializer 来启动加密
104+
2.返回先前创建的 SecureChatServerInitializer 来启用加密
105105

106-
这样,就在所有的通信中使用了 [SSL/TLS](http://tools.ietf.org/html/rfc5246) 加密。下面是启动程序:
106+
这样,就在所有的通信中使用了 [SSL/TLS](http://tools.ietf.org/html/rfc5246) 加密。和前面一样,你可以使用Maven拉取应用需要的所有依赖,并启动它,如下所示。
107107

108108
Listing 11.8 Start the SecureChatServer
109109

@@ -121,5 +121,5 @@ Listing 11.8 Start the SecureChatServer
121121
[INFO] --- exec-maven-plugin:1.2.1:exec (default-cli) @ chat-server ---
122122
Starting SecureChatServer on port 9999
123123

124-
可以通过 HTTPS 地址: https://localhost:9999 来访问SecureChatServer
124+
现在你可以通过 HTTPS 地址: https://localhost:9999 来访问SecureChatServer 了。
125125

0 commit comments

Comments
 (0)