Files
trojan-go/developer/websocket/index.html
T
2020-04-22 23:08:58 -04:00

164 lines
7.7 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="en-us">
<head><meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>Websocket - Trojan-Go</title>
<meta name="description" content="An unidentifiable mechanism that helps you bypass GFW. ">
<meta name="generator" content="Hugo 0.69.1" />
<link href="https://p4gefau1t.github.io/trojan-goindex.xml" rel="alternate" type="application/rss+xml">
<link rel="canonical" href="https://p4gefau1t.github.io/trojan-go/developer/websocket/">
<link rel="stylesheet" href="https://p4gefau1t.github.io/trojan-go/css/theme.min.css">
<script src="https://use.fontawesome.com/releases/v5.0.6/js/all.js"></script>
<link rel="stylesheet" href="https://p4gefau1t.github.io/trojan-go/css/chroma.min.css">
<script src="https://cdn.jsdelivr.net/npm/jquery@3.4.1/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jquery.easing@1.4.1/jquery.easing.min.js"></script>
<script src="https://p4gefau1t.github.io/trojan-go/js/bundle.js"></script><style>
:root {}
</style>
<meta property="og:title" content="Websocket" />
<meta property="og:description" content="由于使用CDN中转时,HTTPS对CDN透明,CDN可以审查Websocket传输内容,而Trojan协议头部特征过于明显(SHA224&" />
<meta property="og:type" content="article" />
<meta property="og:url" content="https://p4gefau1t.github.io/trojan-go/developer/websocket/" />
<meta property="og:image" content="https://p4gefau1t.github.io/trojan-go/images/og-image.png"/>
<meta property="og:site_name" content="Hugo Techdoc Theme" />
<meta name="twitter:card" content="summary_large_image"/>
<meta name="twitter:image" content="https://p4gefau1t.github.io/trojan-go/images/og-image.png"/>
<meta name="twitter:title" content="Websocket"/>
<meta name="twitter:description" content="由于使用CDN中转时,HTTPS对CDN透明,CDN可以审查Websocket传输内容,而Trojan协议头部特征过于明显(SHA224&"/>
<meta itemprop="name" content="Websocket">
<meta itemprop="description" content="由于使用CDN中转时,HTTPS对CDN透明,CDN可以审查Websocket传输内容,而Trojan协议头部特征过于明显(SHA224&">
<meta itemprop="wordCount" content="538">
<meta itemprop="image" content="https://p4gefau1t.github.io/trojan-go/images/og-image.png"/>
<meta itemprop="keywords" content="" /></head>
<body><div class="container"><header>
<h1>Trojan-Go</h1>
<span class="version">Version 0.3.0</span>
<a href="https://github.com/p4gefau1t/trojan-go" class="github"><i class="fab fa-github"></i></a>
<p class="description">An unidentifiable mechanism that helps you bypass GFW. </p>
</header>
<div class="global-menu">
<nav>
<ul>
<li><a href="/trojan-go/">Home</a></li>
<li><a href="https://github.com/p4gefau1t">GitHub</a></li>
<li><a href="https://twitter.com/p4gefau1t">Twitter</a></li></ul>
</nav>
</div>
<div class="content-container">
<main><h1>Websocket</h1>
<p>由于使用CDN中转时,HTTPS对CDN透明,CDN可以审查Websocket传输内容,而Trojan协议头部特征过于明显(SHA224,&quot;\r\n&quot;等),为了保证不被审查和传输安全,默认情况下还会进行一次AES加密(混淆层)和TLS连接(双重TLS)。</p>
<p>开启Websocket的客户端可以使用<code>password</code>字段开启混淆,以及使用<code>double_tls</code>启用双重TLS以确保连接安全性。</p>
<p>混淆层使用AES-CTR-128加密方式,使用<code>password</code>的md5作为主密钥对承载流量进行加密,这层加密作用仅仅是混淆流量特征,而不是保护数据安全。它不保证数据完整性和身份认证,因此可能遭受中间人攻击和重放攻击。如果CDN不可信,或者遭受了基于HTTPS劫持的中间人攻击,应启用双重TLS保证数据传输安全。</p>
<p>如果使用了双重TLS,握手造成的延迟可能略有增加,但是只要开启<code>session_reuse</code><code>session_ticket</code>复用TLS连接,以及开启<code>mux</code>启用TLS多路复用,只会刚刚开启Trojan-Go时察觉明显的延迟。</p>
<p>协议栈如下:</p>
<table>
<thead>
<tr>
<th>协议</th>
</tr>
</thead>
<tbody>
<tr>
<td>真实流量</td>
</tr>
<tr>
<td>simplesocks(如果使用mux)</td>
</tr>
<tr>
<td>smux(如果使用mux)</td>
</tr>
<tr>
<td>trojan</td>
</tr>
<tr>
<td>TLS(如果开启双重TLS)</td>
</tr>
<tr>
<td>混淆层(如果开启混淆)</td>
</tr>
<tr>
<td>Websocket</td>
</tr>
<tr>
<td>TLS</td>
</tr>
<tr>
<td>TCP</td>
</tr>
</tbody>
</table>
<div class="edit-meta">
<br><a href="https://github.com/p4gefau1t/trojan-go/docs/edit/master/content/developer/websocket.md" class="edit-page"><i class="fas fa-pen-square"></i> Edit on GitHub</a></div><nav class="pagination"><a class="nav nav-prev" href="https://p4gefau1t.github.io/trojan-go/developer/mux/" title="多路复用"><i class="fas fa-arrow-left" aria-hidden="true"></i> Prev - 多路复用</a>
<a class="nav nav-next" href="https://p4gefau1t.github.io/trojan-go/developer/api/" title="API">Next - API <i class="fas fa-arrow-right" aria-hidden="true"></i></a>
</nav><footer><p class="powered">Powered by <a href="https://gohugo.io">Hugo</a>. Theme by <a href="https://themes.gohugo.io/hugo-theme-techdoc/">TechDoc</a>. Designed by <a href="https://github.com/thingsym/hugo-theme-techdoc">Thingsym</a>.</p>
</footer>
</main><div class="sidebar">
<nav class="open-menu">
<ul>
<li class=""><a href="https://p4gefau1t.github.io/trojan-go">Home</a></li>
<li class=""><a href="https://p4gefau1t.github.io/trojan-go/basic/">基本配置</a>
<ul class="sub-menu">
<li class=""><a href="https://p4gefau1t.github.io/trojan-go/basic/trojan/">Trojan基本原理</a></li>
<li class=""><a href="https://p4gefau1t.github.io/trojan-go/basic/config/">正确配置Trojan-Go</a></li>
<li class=""><a href="https://p4gefau1t.github.io/trojan-go/basic/fullconfig/">完整的配置文件</a></li>
</ul>
</li>
<li class=""><a href="https://p4gefau1t.github.io/trojan-go/advance/">高级配置</a>
<ul class="sub-menu">
<li class=""><a href="https://p4gefau1t.github.io/trojan-go/advance/mux/">启用多路复用提升并发性能</a></li>
<li class=""><a href="https://p4gefau1t.github.io/trojan-go/advance/websocket/">使用Websocket进行CDN转发</a></li>
<li class=""><a href="https://p4gefau1t.github.io/trojan-go/advance/router/">国内直连和广告屏蔽</a></li>
<li class=""><a href="https://p4gefau1t.github.io/trojan-go/advance/relay/">流量中继</a></li>
<li class=""><a href="https://p4gefau1t.github.io/trojan-go/advance/forward/">DNS隧道和反向代理</a></li>
</ul>
</li>
<li class="parent"><a href="https://p4gefau1t.github.io/trojan-go/developer/">实现细节和开发指南</a>
<ul class="sub-menu">
<li class=""><a href="https://p4gefau1t.github.io/trojan-go/developer/overview/">基本介绍</a></li>
<li class=""><a href="https://p4gefau1t.github.io/trojan-go/developer/trojan/">Trojan协议</a></li>
<li class=""><a href="https://p4gefau1t.github.io/trojan-go/developer/mux/">多路复用</a></li>
<li class="active"><a href="https://p4gefau1t.github.io/trojan-go/developer/websocket/">Websocket</a></li>
<li class=""><a href="https://p4gefau1t.github.io/trojan-go/developer/api/">API</a></li>
</ul>
</li>
</ul>
</nav>
<div class="sidebar-footer"></div>
</div>
</div><a href="#" id="backtothetop-fixed" class="backtothetop"
data-backtothetop-duration="600"
data-backtothetop-easing="easeOutQuart"
data-backtothetop-fixed-fadeIn="1000"
data-backtothetop-fixed-fadeOut="1000"
data-backtothetop-fixed-bottom="10"
data-backtothetop-fixed-right="20">
<span class="fa-layers fa-fw">
<i class="fas fa-circle"></i>
<i class="fas fa-arrow-circle-up"></i>
</span></a>
</div>
</body>
</html>