Skip to content

Commit 7716ed9

Browse files
update site
- add SSL examples - add changelog for version 2.0.1
1 parent 1f90ffc commit 7716ed9

19 files changed

+197
-70
lines changed

changelog.html

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<!DOCTYPE html>
22
<!--
3-
| Generated by Apache Maven Doxia Site Renderer 1.9.2 from src/site/markdown/changelog.md at 2021-11-24
3+
| Generated by Apache Maven Doxia Site Renderer 1.9.2 from src/site/markdown/changelog.md at 2022-06-29
44
| Rendered using Apache Maven Fluido Skin 1.9
55
-->
66
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
77
<head>
88
<meta charset="UTF-8" />
99
<meta name="viewport" content="width=device-width, initial-scale=1" />
1010
<meta name="generator" content="Apache Maven Doxia Site Renderer 1.9.2" />
11-
<title>socket.io-client &#x2013; 2.0.0 (2020-12-14)</title>
11+
<title>socket.io-client &#x2013; 2.0.1 (2021-04-27)</title>
1212
<link rel="stylesheet" href="./css/apache-maven-fluido-1.9.min.css" />
1313
<link rel="stylesheet" href="./css/site.css" />
1414
<link rel="stylesheet" href="./css/print.css" media="print" />
@@ -32,7 +32,7 @@
3232

3333
<div id="breadcrumbs">
3434
<ul class="breadcrumb">
35-
<li id="publishDate">Last Published: 2021-11-24<span class="divider">|</span>
35+
<li id="publishDate">Last Published: 2022-06-29<span class="divider">|</span>
3636
</li>
3737
<li id="projectVersion">Version: 2.0.2-SNAPSHOT</li>
3838
</ul>
@@ -68,6 +68,15 @@
6868
</header>
6969
<main id="bodyColumn" class="span10" >
7070
<section>
71+
<h2><a name="a2.0.1_.282021-04-27.29"></a><a class="externalLink" href="https://github.com/socketio/socket.io-client-java/compare/socket.io-client-2.0.0...socket.io-client-2.0.1">2.0.1</a> (2021-04-27)</h2><section>
72+
<h3><a name="Bug_Fixes"></a>Bug Fixes</h3>
73+
<ul>
74+
75+
<li>fix usage with <a class="externalLink" href="ws://">ws://</a> scheme (<a class="externalLink" href="https://github.com/socketio/socket.io-client-java/commit/67fd5f34a31c63f7884f82ab39386ad343527590">67fd5f3</a>)</li>
76+
<li>ensure buffered events are sent in order (<a class="externalLink" href="https://github.com/socketio/socket.io-client-java/commit/4885e7d59fad78285448694cb5681e8a9ce809ef">4885e7d</a>)</li>
77+
<li>ensure the payload format is valid (<a class="externalLink" href="https://github.com/socketio/socket.io-client-java/commit/e8ffe9d1383736f6a21090ab959a2f4fa5a41284">e8ffe9d</a>)</li>
78+
<li>emit a CONNECT_ERROR event upon connection failure (<a class="externalLink" href="https://github.com/socketio/socket.io-client-java/commit/d324e7f396a444ddd556c3d70a85a28eefb1e02b">d324e7f</a>)</li>
79+
</ul></section></section><section>
7180
<h2><a name="a2.0.0_.282020-12-14.29"></a><a class="externalLink" href="https://github.com/socketio/socket.io-client-java/compare/socket.io-client-1.0.1...socket.io-client-2.0.0">2.0.0</a> (2020-12-14)</h2><section>
7281
<h3><a name="Features"></a>Features</h3>
7382
<ul>
@@ -89,7 +98,7 @@ <h3><a name="Bug_Fixes"></a>Bug Fixes</h3>
8998
<footer>
9099
<div class="container-fluid">
91100
<div class="row-fluid">
92-
<p>&#169; 2021
101+
<p>&#169; 2022
93102
</p>
94103
</div>
95104
</div>

dependencies.html

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!DOCTYPE html>
22
<!--
3-
| Generated by Apache Maven Doxia Site Renderer 1.9.2 from org.apache.maven.plugins:maven-project-info-reports-plugin:3.1.1:dependencies at 2021-11-24
3+
| Generated by Apache Maven Doxia Site Renderer 1.9.2 from org.apache.maven.plugins:maven-project-info-reports-plugin:3.1.1:dependencies at 2022-06-29
44
| Rendered using Apache Maven Fluido Skin 1.9
55
-->
66
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
@@ -32,7 +32,7 @@
3232

3333
<div id="breadcrumbs">
3434
<ul class="breadcrumb">
35-
<li id="publishDate">Last Published: 2021-11-24<span class="divider">|</span>
35+
<li id="publishDate">Last Published: 2022-06-29<span class="divider">|</span>
3636
</li>
3737
<li id="projectVersion">Version: 2.0.2-SNAPSHOT</li>
3838
</ul>
@@ -142,10 +142,10 @@ <h3><a name="compile"></a>compile</h3>
142142
<th>Licenses</th></tr>
143143
<tr class="b">
144144
<td>com.squareup.okhttp3</td>
145-
<td>okhttp</td>
145+
<td><a class="externalLink" href="https://github.com/square/okhttp/okhttp">okhttp</a></td>
146146
<td>3.12.12</td>
147147
<td>jar</td>
148-
<td>-</td></tr>
148+
<td><a class="externalLink" href="http://www.apache.org/licenses/LICENSE-2.0.txt">Apache 2.0</a></td></tr>
149149
<tr class="a">
150150
<td>com.squareup.okio</td>
151151
<td><a class="externalLink" href="https://github.com/square/okio/okio">okio</a></td>
@@ -216,7 +216,15 @@ <h3><a name="Dependency_Tree"></a>Dependency Tree</h3>
216216
<p><b>URL: </b><a class="externalLink" href="https://github.com/socketio/engine.io-client-java">https://github.com/socketio/engine.io-client-java</a></p>
217217
<p><b>Project Licenses: </b><a class="externalLink" href="http://opensource.org/licenses/mit-license">The MIT License (MIT)</a></p></td></tr></table></div>
218218
<ul>
219-
<li>com.squareup.okhttp3:okhttp:jar:3.12.12 (compile) <img id="_img5" src="./images/icon_info_sml.gif" alt="[Information]" onclick="toggleDependencyDetails( '_dep4', '_img5' );" style="cursor: pointer; vertical-align: text-bottom;"></img><div id="_dep4" style="display:none"></td></tr></table></div>
219+
<li>com.squareup.okhttp3:okhttp:jar:3.12.12 (compile) <img id="_img5" src="./images/icon_info_sml.gif" alt="[Information]" onclick="toggleDependencyDetails( '_dep4', '_img5' );" style="cursor: pointer; vertical-align: text-bottom;"></img><div id="_dep4" style="display:none">
220+
<table border="0" class="table table-striped">
221+
<tr class="a">
222+
<th>OkHttp</th></tr>
223+
<tr class="b">
224+
<td>
225+
<p><b>Description: </b>An HTTP+HTTP/2 client for Android and Java applications</p>
226+
<p><b>URL: </b><a class="externalLink" href="https://github.com/square/okhttp/okhttp">https://github.com/square/okhttp/okhttp</a></p>
227+
<p><b>Project Licenses: </b><a class="externalLink" href="http://www.apache.org/licenses/LICENSE-2.0.txt">Apache 2.0</a></p></td></tr></table></div>
220228
<ul>
221229
<li>com.squareup.okio:okio:jar:1.15.0 (compile) <img id="_img7" src="./images/icon_info_sml.gif" alt="[Information]" onclick="toggleDependencyDetails( '_dep6', '_img7' );" style="cursor: pointer; vertical-align: text-bottom;"></img><div id="_dep6" style="display:none">
222230
<table border="0" class="table table-striped">
@@ -294,7 +302,7 @@ <h3><a name="Dependency_Tree"></a>Dependency Tree</h3>
294302
<h2><a name="Licenses"></a>Licenses</h2>
295303
<p><b>The MIT License (MIT): </b>engine.io-client, socket.io-client</p>
296304
<p><b>provided without support or warranty: </b>JSON (JavaScript Object Notation)</p>
297-
<p><b>Apache 2.0: </b>Okio</p>
305+
<p><b>Apache 2.0: </b>OkHttp, Okio</p>
298306
<p><b>Eclipse Public License 1.0: </b>JUnit</p>
299307
<p><b>Apache License 2.0: </b>JSON library from Android SDK</p>
300308
<p><b>New BSD License: </b>Hamcrest Core, Hamcrest library</p>
@@ -420,7 +428,7 @@ <h2><a name="Dependency_File_Details"></a>Dependency File Details</h2>
420428
<footer>
421429
<div class="container-fluid">
422430
<div class="row-fluid">
423-
<p>&#169; 2021
431+
<p>&#169; 2022
424432
</p>
425433
</div>
426434
</div>

dependency-info.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!DOCTYPE html>
22
<!--
3-
| Generated by Apache Maven Doxia Site Renderer 1.9.2 from org.apache.maven.plugins:maven-project-info-reports-plugin:3.1.1:dependency-info at 2021-11-24
3+
| Generated by Apache Maven Doxia Site Renderer 1.9.2 from org.apache.maven.plugins:maven-project-info-reports-plugin:3.1.1:dependency-info at 2022-06-29
44
| Rendered using Apache Maven Fluido Skin 1.9
55
-->
66
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
@@ -32,7 +32,7 @@
3232

3333
<div id="breadcrumbs">
3434
<ul class="breadcrumb">
35-
<li id="publishDate">Last Published: 2021-11-24<span class="divider">|</span>
35+
<li id="publishDate">Last Published: 2022-06-29<span class="divider">|</span>
3636
</li>
3737
<li id="projectVersion">Version: 2.0.2-SNAPSHOT</li>
3838
</ul>
@@ -110,7 +110,7 @@ <h3><a name="Leiningen"></a>Leiningen</h3><a name="Leiningen"></a>
110110
<footer>
111111
<div class="container-fluid">
112112
<div class="row-fluid">
113-
<p>&#169; 2021
113+
<p>&#169; 2022
114114
</p>
115115
</div>
116116
</div>

distribution-management.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!DOCTYPE html>
22
<!--
3-
| Generated by Apache Maven Doxia Site Renderer 1.9.2 from org.apache.maven.plugins:maven-project-info-reports-plugin:3.1.1:distribution-management at 2021-11-24
3+
| Generated by Apache Maven Doxia Site Renderer 1.9.2 from org.apache.maven.plugins:maven-project-info-reports-plugin:3.1.1:distribution-management at 2022-06-29
44
| Rendered using Apache Maven Fluido Skin 1.9
55
-->
66
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
@@ -32,7 +32,7 @@
3232

3333
<div id="breadcrumbs">
3434
<ul class="breadcrumb">
35-
<li id="publishDate">Last Published: 2021-11-24<span class="divider">|</span>
35+
<li id="publishDate">Last Published: 2022-06-29<span class="divider">|</span>
3636
</li>
3737
<li id="projectVersion">Version: 2.0.2-SNAPSHOT</li>
3838
</ul>
@@ -91,7 +91,7 @@ <h3><a name="Snapshot_Repository_-_ossrh"></a>Snapshot Repository - ossrh</h3><a
9191
<footer>
9292
<div class="container-fluid">
9393
<div class="row-fluid">
94-
<p>&#169; 2021
94+
<p>&#169; 2022
9595
</p>
9696
</div>
9797
</div>

emitting_events.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!DOCTYPE html>
22
<!--
3-
| Generated by Apache Maven Doxia Site Renderer 1.9.2 from src/site/markdown/emitting_events.md at 2021-11-24
3+
| Generated by Apache Maven Doxia Site Renderer 1.9.2 from src/site/markdown/emitting_events.md at 2022-06-29
44
| Rendered using Apache Maven Fluido Skin 1.9
55
-->
66
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
@@ -32,7 +32,7 @@
3232

3333
<div id="breadcrumbs">
3434
<ul class="breadcrumb">
35-
<li id="publishDate">Last Published: 2021-11-24<span class="divider">|</span>
35+
<li id="publishDate">Last Published: 2022-06-29<span class="divider">|</span>
3636
</li>
3737
<li id="projectVersion">Version: 2.0.2-SNAPSHOT</li>
3838
</ul>
@@ -214,7 +214,7 @@ <h3><a name="From_server_to_client"></a>From server to client</h3>
214214
<footer>
215215
<div class="container-fluid">
216216
<div class="row-fluid">
217-
<p>&#169; 2021
217+
<p>&#169; 2022
218218
</p>
219219
</div>
220220
</div>

index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!DOCTYPE html>
22
<!--
3-
| Generated by Apache Maven Doxia Site Renderer 1.9.2 from org.apache.maven.plugins:maven-project-info-reports-plugin:3.1.1:index at 2021-11-24
3+
| Generated by Apache Maven Doxia Site Renderer 1.9.2 from org.apache.maven.plugins:maven-project-info-reports-plugin:3.1.1:index at 2022-06-29
44
| Rendered using Apache Maven Fluido Skin 1.9
55
-->
66
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
@@ -32,7 +32,7 @@
3232

3333
<div id="breadcrumbs">
3434
<ul class="breadcrumb">
35-
<li id="publishDate">Last Published: 2021-11-24<span class="divider">|</span>
35+
<li id="publishDate">Last Published: 2022-06-29<span class="divider">|</span>
3636
</li>
3737
<li id="projectVersion">Version: 2.0.2-SNAPSHOT</li>
3838
</ul>
@@ -89,7 +89,7 @@ <h2><a name="About_socket.io-client"></a>About socket.io-client</h2><a name="Abo
8989
<footer>
9090
<div class="container-fluid">
9191
<div class="row-fluid">
92-
<p>&#169; 2021
92+
<p>&#169; 2022
9393
</p>
9494
</div>
9595
</div>

initialization.html

Lines changed: 119 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!DOCTYPE html>
22
<!--
3-
| Generated by Apache Maven Doxia Site Renderer 1.9.2 from src/site/markdown/initialization.md at 2021-11-24
3+
| Generated by Apache Maven Doxia Site Renderer 1.9.2 from src/site/markdown/initialization.md at 2022-06-29
44
| Rendered using Apache Maven Fluido Skin 1.9
55
-->
66
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
@@ -32,7 +32,7 @@
3232

3333
<div id="breadcrumbs">
3434
<ul class="breadcrumb">
35-
<li id="publishDate">Last Published: 2021-11-24<span class="divider">|</span>
35+
<li id="publishDate">Last Published: 2022-06-29<span class="divider">|</span>
3636
</li>
3737
<li id="projectVersion">Version: 2.0.2-SNAPSHOT</li>
3838
</ul>
@@ -85,10 +85,16 @@ <h1>Initialization</h1>
8585
<li><a href="#rememberUpgrade">rememberUpgrade</a></li>
8686
<li><a href="#path">path</a></li>
8787
<li><a href="#query">query</a></li>
88-
<li><a href="#extraHeaders">extraHeaders</a></li></ul></li>
88+
<li><a href="#extraHeaders">extraHeaders</a></li>
89+
<li><a href="#callFactory">callFactory</a></li>
90+
<li><a href="#webSocketFactory">webSocketFactory</a></li></ul></li>
8991
<li><a href="#Socket_options">Socket options</a>
9092
<ul>
91-
<li><a href="#auth">auth</a></li></ul></li></ul></li></ul>
93+
<li><a href="#auth">auth</a></li></ul></li></ul></li>
94+
<li><a href="#SSL_connections">SSL connections</a>
95+
<ul>
96+
<li><a href="#With_a_keystore">With a keystore</a></li>
97+
<li><a href="#Trust_all_certificates">Trust all certificates</a></li></ul></li></ul>
9298
<section>
9399
<h2><a name="Creation_of_a_Socket_instance"></a>Creation of a Socket instance</h2>
94100

@@ -318,6 +324,35 @@ <h4><a name="extraHeaders"></a><code>extraHeaders</code></h4>
318324
}
319325
});
320326
</pre></div></div>
327+
</section><section>
328+
<h4><a name="callFactory"></a><code>callFactory</code></h4>
329+
<p>The <a class="externalLink" href="https://square.github.io/okhttp/4.x/okhttp/okhttp3/-ok-http-client/">OkHttpClient instance</a> to use for HTTP long-polling requests.</p>
330+
331+
<div class="source">
332+
<div class="source"><pre class="prettyprint">OkHttpClient okHttpClient = new OkHttpClient.Builder()
333+
.readTimeout(1000, TimeUnit.MILLISECONDS)
334+
.writeTimeout(1000, TimeUnit.MILLISECONDS)
335+
.build();
336+
337+
IO.Options options = new IO.Options();
338+
options.callFactory = okHttpClient;
339+
340+
Socket socket = IO.socket(URI.create(&quot;https://example.com&quot;), options);
341+
</pre></div></div>
342+
</section><section>
343+
<h4><a name="webSocketFactory"></a><code>webSocketFactory</code></h4>
344+
<p>The <a class="externalLink" href="https://square.github.io/okhttp/4.x/okhttp/okhttp3/-ok-http-client/">OkHttpClient instance</a> to use for WebSocket connections.</p>
345+
346+
<div class="source">
347+
<div class="source"><pre class="prettyprint">OkHttpClient okHttpClient = new OkHttpClient.Builder()
348+
.minWebSocketMessageToCompress(2048)
349+
.build();
350+
351+
IO.Options options = new IO.Options();
352+
options.webSocketFactory = okHttpClient;
353+
354+
Socket socket = IO.socket(URI.create(&quot;https://example.com&quot;), options);
355+
</pre></div></div>
321356
</section></section><section>
322357
<h3><a name="Socket_options"></a>Socket options</h3>
323358
<p>These settings are specific to the given Socket instance.</p><section>
@@ -360,15 +395,93 @@ <h4><a name="auth"></a><code>auth</code></h4>
360395
<div class="source">
361396
<div class="source"><pre class="prettyprint">options.auth.put(&quot;token&quot;, &quot;efgh&quot;);
362397
socket.disconnect().connect();
363-
</pre></div></div></section></section></section>
398+
</pre></div></div>
399+
</section></section></section><section>
400+
<h2><a name="SSL_connections"></a>SSL connections</h2><section>
401+
<h3><a name="With_a_keystore"></a>With a keystore</h3>
402+
403+
<div class="source">
404+
<div class="source"><pre class="prettyprint">HostnameVerifier hostnameVerifier = new HostnameVerifier() {
405+
public boolean verify(String hostname, SSLSession sslSession) {
406+
return hostname.equals(&quot;example.com&quot;);
407+
}
408+
};
409+
410+
KeyStore ks = KeyStore.getInstance(&quot;JKS&quot;);
411+
File file = new File(&quot;path/to/the/keystore.jks&quot;);
412+
ks.load(new FileInputStream(file), &quot;password&quot;.toCharArray());
413+
414+
KeyManagerFactory kmf = KeyManagerFactory.getInstance(&quot;SunX509&quot;);
415+
kmf.init(ks, &quot;password&quot;.toCharArray());
416+
417+
TrustManagerFactory tmf = TrustManagerFactory.getInstance(&quot;SunX509&quot;);
418+
tmf.init(ks);
419+
420+
SSLContext sslContext = SSLContext.getInstance(&quot;TLS&quot;);
421+
sslContext.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);
422+
423+
OkHttpClient okHttpClient = new OkHttpClient.Builder()
424+
.hostnameVerifier(hostnameVerifier)
425+
.sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) tmf.getTrustManagers()[0])
426+
.build();
427+
428+
IO.Options options = new IO.Options();
429+
options.callFactory = okHttpClient;
430+
options.webSocketFactory = okHttpClient;
431+
432+
Socket socket = IO.socket(URI.create(&quot;https://example.com&quot;), options);
433+
</pre></div></div>
434+
</section><section>
435+
<h3><a name="Trust_all_certificates"></a>Trust all certificates</h3>
436+
<p>Please use with caution, as this defeats the whole purpose of using secure connections.</p>
437+
<p>This is equivalent to <code>rejectUnauthorized: false</code> for the JavaScript client.</p>
438+
439+
<div class="source">
440+
<div class="source"><pre class="prettyprint">HostnameVerifier hostnameVerifier = new HostnameVerifier() {
441+
@Override
442+
public boolean verify(String hostname, SSLSession sslSession) {
443+
return true;
444+
}
445+
};
446+
447+
X509TrustManager trustManager = new X509TrustManager() {
448+
public X509Certificate[] getAcceptedIssuers() {
449+
return new X509Certificate[] {};
450+
}
451+
452+
@Override
453+
public void checkClientTrusted(X509Certificate[] arg0, String arg1) {
454+
// not implemented
455+
}
456+
457+
@Override
458+
public void checkServerTrusted(X509Certificate[] arg0, String arg1) {
459+
// not implemented
460+
}
461+
};
462+
463+
SSLContext sslContext = SSLContext.getInstance(&quot;TLS&quot;);
464+
sslContext.init(null, new TrustManager[] { trustManager }, null);
465+
466+
OkHttpClient okHttpClient = new OkHttpClient.Builder()
467+
.hostnameVerifier(hostnameVerifier)
468+
.sslSocketFactory(sslContext.getSocketFactory(), trustManager)
469+
.build();
470+
471+
IO.Options options = new IO.Options();
472+
options.callFactory = okHttpClient;
473+
options.webSocketFactory = okHttpClient;
474+
475+
Socket socket = IO.socket(URI.create(&quot;https://example.com&quot;), options);
476+
</pre></div></div></section></section>
364477
</main>
365478
</div>
366479
</div>
367480
<hr/>
368481
<footer>
369482
<div class="container-fluid">
370483
<div class="row-fluid">
371-
<p>&#169; 2021
484+
<p>&#169; 2022
372485
</p>
373486
</div>
374487
</div>

0 commit comments

Comments
 (0)