Skip to content

Commit bf2988b

Browse files
1 parent ed91316 commit bf2988b

File tree

268 files changed

+11035
-5916
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

268 files changed

+11035
-5916
lines changed

.gitignore

+21-17
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
1-
.htaccess
2-
wp-content/uploads/
3-
wp-content/blogs.dir/
4-
wp-content/upgrade/
5-
wp-content/backup-db/
6-
wp-content/advanced-cache.php
7-
wp-content/wp-cache-config.php
8-
sitemap.xml
9-
*.log
10-
wp-content/cache/
11-
wp-content/backups/
12-
sitemap.xml.gz
13-
wp-config.php
14-
node_modules
15-
*.DS_Store
16-
public/
17-
db.json
1+
# Dependencies
2+
/node_modules
3+
4+
# Production
5+
/build
6+
7+
# Generated files
8+
.docusaurus
9+
.cache-loader
10+
11+
# Misc
12+
.DS_Store
13+
.env.local
14+
.env.development.local
15+
.env.test.local
16+
.env.production.local
17+
18+
npm-debug.log*
19+
yarn-debug.log*
20+
yarn-error.log*
21+
1822
.idea
1923
.now

README.md

+30-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,33 @@
1+
# Website
12

2-
# socket.io-website
3+
This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.
34

4-
Socket.IO website and blog at https://socket.io/.
5+
## Installation
56

7+
```console
8+
yarn install
9+
```
10+
11+
## Local Development
12+
13+
```console
14+
yarn start
15+
```
16+
17+
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
18+
19+
## Build
20+
21+
```console
22+
yarn build
23+
```
24+
25+
This command generates static content into the `build` directory and can be served using any static contents hosting service.
26+
27+
## Deployment
28+
29+
```console
30+
GIT_USER=<Your GitHub username> USE_SSH=true yarn deploy
31+
```
32+
33+
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.

_config.yml

-80
This file was deleted.

babel.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: [require.resolve("@docusaurus/core/lib/babel/preset")],
3+
};

source/_posts/20140528-1.0.0.md renamed to blog/2014-05-28-1.0.0.md

+11-10
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1+
---
12
title: Introducing Socket.IO 1.0
2-
permalink: /blog/introducing-socket-io-1-0/
3-
date: 2014-05-28
4-
author_name: Guillermo Rauch
5-
author_link: https://twitter.com/rauchg
3+
slug: /introducing-socket-io-1-0/
4+
authors: rauchg
65
---
76

87
The first version of Socket.IO was created shortly after Node.JS made its first appearance. I had been looking for a framework that easily enabled me to push data from a server to a client for a long time, and even had tried other approaches to server-side JavaScript.
98

9+
<!--truncate-->
10+
1011
At the time, the main focus was on an interface equivalent to the upcoming `WebSocket` API that was in the process of standardization. I was lucky to receive a lot of feedback from the community at the time (including Node.JS's creator) that helped shape the project into something significantly more useful.
1112

1213
Socket.IO has thus become the `EventEmitter` of the web. Today I want to talk about the work that has gone into 1.0 to round up this vision.
@@ -76,9 +77,9 @@ io.on('connection', function(socket){
7677
});
7778
```
7879

79-
To test how useful it would be to support binary in this particular way (and as a virtualization geek), I decided to replicate the <a href="http://en.wikipedia.org/wiki/Twitch_Plays_Pok%C3%A9mon">Twitch Plays Pokemon</a> experiment 100% in JavaScript. Using a <a href="https://github.com/grantgalitz/GameBoy-Online">JavaScript gameboy emulator</a>, <a href="http://github.com/automattic/node-canvas">node-canvas</a>, socket.io we came up with a server-rendered collaborative game that even works on IE8. Check it out on <a href="http://weplay.io/">http://weplay.io</a> (<a href="https://github.com/guille/weplay">source code here</a>).
80+
To test how useful it would be to support binary in this particular way (and as a virtualization geek), I decided to replicate the <a href="http://en.wikipedia.org/wiki/Twitch_Plays_Pok%C3%A9mon">Twitch Plays Pokemon</a> experiment 100% in JavaScript. Using a <a href="https://github.com/grantgalitz/GameBoy-Online">JavaScript gameboy emulator</a>, <a href="http://github.com/automattic/node-canvas">node-canvas</a>, socket.io we came up with a server-rendered collaborative game that even works on IE8. Check it out on https://weplay.io (<a href="https://github.com/guille/weplay">source code here</a>).
8081

81-
<video id="weplay-vid" data-setup="{&quot;autoplay&quot;:true,&quot;loop&quot;:true, &quot;techOrder&quot;: [&quot;html5&quot;, &quot;flash&quot;], &quot;height&quot;: 300}" class="video-js vjs-default-skin" autoplay loop width="100%" poster="https://i.cloudup.com/aNZqxnZzHv.png"><source src="https://i.cloudup.com/transcoded/KL-0r-E2Gj.mp4" type="video/mp4"></video>
82+
<video id="weplay-vid" data-setup="{&quot;autoplay&quot;:true,&quot;loop&quot;:true, &quot;techOrder&quot;: [&quot;html5&quot;, &quot;flash&quot;], &quot;height&quot;: 300}" className="video-js vjs-default-skin" autoPlay loop width="100%" poster="https://i.cloudup.com/aNZqxnZzHv.png"><source src="https://i.cloudup.com/transcoded/KL-0r-E2Gj.mp4" type="video/mp4" /></video>
8283

8384
The relevant code that sends the image data is:
8485

@@ -89,9 +90,9 @@ self.canvas.toBuffer(function(err, buf){
8990
});
9091
```
9192

92-
The next experiment was to run an instance of <a href="http://wiki.qemu.org/Main_Page">QEMU</a> running an image of Windows XP, in honor of <a href="http://indianexpress.com/article/technology/technology-others/windows-xp-end-of-support-today/">its retirement</a>. Every player gets a 15 second turn to control the machine. Check out the demo on <a href="http://socket.computer/">http://socket.computer</a>. Here's a video of your typical inception scenario:
93+
The next experiment was to run an instance of <a href="http://wiki.qemu.org/Main_Page">QEMU</a> running an image of Windows XP, in honor of <a href="http://indianexpress.com/article/technology/technology-others/windows-xp-end-of-support-today/">its retirement</a>. Every player gets a 15 second turn to control the machine. Check out the demo on http://socket.computer. Here's a video of your typical inception scenario:
9394

94-
<video id="computer-vid" data-setup="{&quot;autoplay&quot;:true,&quot;loop&quot;:true, &quot;techOrder&quot;: [&quot;html5&quot;, &quot;flash&quot;], &quot;height&quot;: 300}" class="video-js vjs-default-skin" autoplay loop width="100%"><source src="https://i.cloudup.com/transcoded/Cuqn5OLmcl.mp4" type="video/mp4"></video>
95+
<video id="computer-vid" data-setup="{&quot;autoplay&quot;:true,&quot;loop&quot;:true, &quot;techOrder&quot;: [&quot;html5&quot;, &quot;flash&quot;], &quot;height&quot;: 300}" className="video-js vjs-default-skin" autoPlay loop width="100%"><source src="https://i.cloudup.com/transcoded/Cuqn5OLmcl.mp4" type="video/mp4" /></video>
9596

9697
A key part of putting together this demo was connecting to the QEMU VNC server and implementing the RFB protocol. As it's usually the case with Node.JS, the solution was a `npm search rfb` away.
9798

@@ -111,7 +112,7 @@ It then became clear to me that our support for binary data would be genuinely u
111112

112113
Just for fun, I also installed and ran one of my favorite first person shooters:
113114

114-
<video id="cs-vid" data-setup="{&quot;autoplay&quot;:true,&quot;loop&quot;:true, &quot;techOrder&quot;: [&quot;html5&quot;, &quot;flash&quot;], &quot;height&quot;: 300}" class="video-js vjs-default-skin" autoplay loop width="100%"><source src="https://i.cloudup.com/transcoded/Ra6PJnoLBq.mp4" type="video/mp4"></video>
115+
<video id="cs-vid" data-setup="{&quot;autoplay&quot;:true,&quot;loop&quot;:true, &quot;techOrder&quot;: [&quot;html5&quot;, &quot;flash&quot;], &quot;height&quot;: 300}" className="video-js vjs-default-skin" autoPlay loop width="100%"><source src="https://i.cloudup.com/transcoded/Ra6PJnoLBq.mp4" type="video/mp4" /></video>
115116

116117
## Automated Testing
117118

@@ -184,7 +185,7 @@ The basic idea is that each module used by Socket.IO provides different debuggin
184185
185186
You can see it in action for example on our homepage:
186187
187-
<video id="debugging-vid" data-setup="{&quot;autoplay&quot;:true,&quot;loop&quot;:true, &quot;techOrder&quot;: [&quot;html5&quot;, &quot;flash&quot;], &quot;height&quot;: 300}" class="video-js vjs-default-skin" autoplay loop width="100%"><source src="https://i.cloudup.com/transcoded/IL9alTr0eO.mp4" type="video/mp4"></video>
188+
<video id="debugging-vid" data-setup="{&quot;autoplay&quot;:true,&quot;loop&quot;:true, &quot;techOrder&quot;: [&quot;html5&quot;, &quot;flash&quot;], &quot;height&quot;: 300}" className="video-js vjs-default-skin" autoPlay loop width="100%"><source src="https://i.cloudup.com/transcoded/IL9alTr0eO.mp4" type="video/mp4" /></video>
188189
189190
190191
## Streamlined APIs

source/_posts/20150120-native-socket-io-and-android.md renamed to blog/2015-01-20-native-socket-io-and-android.md

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
1+
---
12
title: Native Socket.IO and Android
2-
permalink: /blog/native-socket-io-and-android/
3-
date: 2015-01-20
4-
author_name: Naoyuki Kanezawa
5-
author_link: https://twitter.com/nkzawa
3+
slug: /blog/native-socket-io-and-android/
4+
authors:
5+
- name: Naoyuki Kanezawa
6+
title: Maintainer of Socket.IO
7+
url: https://twitter.com/nkzawa
8+
image_url: https://github.com/nkzawa.png
69
---
710

811
<img class="aligncenter size-full wp-image-626" src="/images/androidchat.gif" alt="android chat demo" width="338" height="600"/>
912

1013
In this tutorial well learn how to create a chat client that communicates with a Socket.IO <a href="https://github.com/socketio/socket.io/blob/master/examples/chat/index.js">Node.JS chat server</a>, with our <a href="https://github.com/socketio/socket.io-client-java">native Android Client</a>! If you want to jump straight to the code, it's on <a href="https://github.com/nkzawa/socket.io-android-chat">GitHub</a>. Otherwise, read on!
1114

15+
<!--truncate-->
16+
1217
## Introduction
1318

1419
To follow along, start by cloning the repository: <a title="socket.io-android-chat" href="https://github.com/nkzawa/socket.io-android-chat" target="_blank">socket.io-android-chat</a>.

source/_posts/20150204-1.3.3.md renamed to blog/2015-02-04-1.3.3.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1+
---
12
title: Socket.IO 1.3.3
2-
permalink: /blog/socket-io-1-3-3/
3-
date: 2015-02-04
4-
author_name: Guillermo Rauch
5-
author_link: https://twitter.com/rauchg
3+
slug: /socket-io-1-3-3/
4+
authors: rauchg
65
---
76

87
Socket.IO **1.3.3** is a backwards-compatible **recommended upgrade** for everyone.

source/_posts/20150214-1.3.4.md renamed to blog/2015-02-14-1.3.4.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1+
---
12
title: Socket.IO 1.3.4
2-
permalink: /blog/socket-io-1-3-4/
3-
date: 2015-02-14
4-
author_name: Guillermo Rauch
5-
author_link: https://twitter.com/rauchg
3+
slug: /socket-io-1-3-4/
4+
authors: rauchg
65
---
76

87
Socket.IO **1.3.4** corrects the `1.3.3` build that included extra unused code.

source/_posts/20150303-1.3.5.md renamed to blog/2015-03-03-1.3.5.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1+
---
12
title: Socket.IO 1.3.5
2-
permalink: /blog/socket-io-1-3-5/
3-
date: 2015-03-03
4-
author_name: Guillermo Rauch
5-
author_link: https://twitter.com/rauchg
3+
slug: /socket-io-1-3-5/
4+
authors: rauchg
65
---
76

87
Socket.IO **1.3.5** addresses a parser issue. Upgrade recommended. Completely backwards-compatible.

source/_posts/20150309-ios.md renamed to blog/2015-03-09-ios.md

+11-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
1+
---
12
title: Socket.IO on iOS
2-
permalink: /blog/socket-io-on-ios/
3-
date: 2015-03-09
4-
author_name: Erik Little
3+
slug: /socket-io-on-ios/
4+
authors:
5+
- name: Erik Little
6+
title: Maintainer of the iOS client
7+
url: https://twitter.com/nuclearace
8+
image_url: https://github.com/nuclearace.png
9+
510
author_link: https://twitter.com/nukeace
611
---
712

8-
<video class="gfyVidIframe" id="gfyVid" autoplay="" loop="" style="-webkit-backface-visibility: hidden;-webkit-transform: scale(1);" height="574" width="323"><source id="webmsource" src="//fat.gfycat.com/EssentialBlueElectriceel.webm" type="video/webm"><source id="mp4source" src="//giant.gfycat.com/EssentialBlueElectriceel.mp4" type="video/mp4"></video>
13+
<video className="gfyVidIframe" id="gfyVid" autoPlay="" loop="" height="574" width="323"><source id="webmsource" src="//fat.gfycat.com/EssentialBlueElectriceel.webm" type="video/webm" /><source id="mp4source" src="//giant.gfycat.com/EssentialBlueElectriceel.mp4" type="video/mp4" /></video>
914

1015
We are pleased to announce the immediate availability of the <a href="https://github.com/socketio/socket.io-client-swift">Socket.IO Swift Client</a>! Youll now be able to write code that runs natively on **iOS** and **OSX**, while maintaining the simplicity and expressiveness of the JavaScript client!
1116

17+
<!--truncate-->
18+
1219
```swift
1320
import Foundation
1421
let socket = SocketIOClient(socketURL: "localhost:8880")

source/_posts/20150413-socket-io-cpp.md renamed to blog/2015-04-13-socket-io-cpp.md

+15-10
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
1+
---
12
title: Socket.IO C++
2-
permalink: /blog/socket-io-cpp/
3-
date: 2015-04-13
4-
author_name: Melo Yao
5-
author_link: https://twitter.com/melode111
3+
slug: /socket-io-cpp/
4+
authors:
5+
- name: Melo Yao
6+
title: Maintainer of the C++ client
7+
url: https://twitter.com/melode111
8+
image_url: https://github.com/melode11.png
69
---
710

811
I'm really proud to announce the first release of the <a href="https://github.com/socketio/socket.io-client-cpp">Socket.IO C++ Client</a> on GitHub!
912

13+
<!--truncate-->
14+
1015
Based on <a href="http://www.boost.org/">Boost</a> and <a href="https://github.com/zaphoyd/websocketpp">WebSocket++</a>, this full-featured Socket.IO 1.0 client has the fundamental advantage of working on **multiple platforms**. Check out the directory of <a href="https://github.com/socketio/socket.io-client-cpp/tree/master/examples">examples</a>. It contains examples of iOS, QT, and CLI chat clients!
1116

1217
To learn how to use this client, I put together a QT chat example that communicates using a <a href="https://github.com/Automattic/socket.io/tree/master/examples/chat">Socket.IO Node.JS chat server</a>. Keep reading for step-by-step instructions.
1318

14-
<p style="text-align: center">
15-
<img src="https://cldup.com/98tHyoJJE7.gif">
19+
<p style={{ 'text-align': 'center' }}>
20+
<img src="https://cldup.com/98tHyoJJE7.gif" />
1621
</p>
1722

1823
## Introduction
@@ -101,8 +106,8 @@ else:unix: LIBS += -L`our osx boost static lib folder` -lboost
101106

102107
Create a simple UI by dragging and dropping a widget from the widget box on the left-hand side.
103108

104-
<p style="text-align: center">
105-
<img src="https://cldup.com/RI98CYpYL5.png">
109+
<p style={{ 'text-align': 'center' }}>
110+
<img src="https://cldup.com/RI98CYpYL5.png" />
106111
</p>
107112

108113
It contains the following:
@@ -142,8 +147,8 @@ In the connection editor, edit the main window slots on the right side. Add the
142147

143148
Then we can connect the event signal to the widget with our own slots. The result should look like this:
144149

145-
<p style="text-align: center">
146-
<img src="https://cldup.com/Vsb-UXG3FC.jpg">
150+
<p style={{ 'text-align': 'center' }}>
151+
<img src="https://cldup.com/Vsb-UXG3FC.jpg" />
147152
</p>
148153

149154
## Adding UI Refresh Signals/Slots

0 commit comments

Comments
 (0)