Good News with ZIM Socket

We got ZIM Socket updated to the latest version of socket.io. And we managed to get the CORS error fixed so that we do not have to add each individual site to a whitelist. Over the next week we will wrap that up nicely - it should mean that we can just use

import zim from "https://zimjs.org/016/zim_socket2" // note the 2

without having to use script tags for the socket.io. So moving to the latest version will solve that too. Almost there... will announce the update here when ready.

Until then, you are welcome to check out ZIM Socket at https://zimjs.com/socket

image

4 Likes

ZIM Socket has been updated to socket.io major version 4 on both the server and client. There is no change needed to the socket code in your app, BUT, the new socket.io server code needs the new socket.io client version.

So, for ZIM version 016 and lower, importing

zim_socket  // will continue to point to the old code
zim_socket2 // will point to the new code

With the old code you still need a script tag to https://zimjs.org/cdn/2.3.0/socket.io.js

With the new code you do not need the extra script tag to socket.io - just the following:

import zim from "https://zimjs.org/cdn/016/zim_socket2";

In version ZIM 017 we will make ZIM_socket call the new one.

The zimSocketURL stays the same and if you use socket2 then it calls socket2.zimjs.org as the server rather than the old socket.zimjs.org.

We will work to make an NPM version of all this soon.

3 Likes