# Problem with socket.io

**URL:** <https://discourse.processing.org/t/problem-with-socket-io/11907>\
**Category:** Libraries\
**Created:** [June 7, 2019, 7:11pm UTC](https://discourse.processing.org/t/problem-with-socket-io/11907 "2019-06-07T19:11:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![LittleBoxes](https://avatars.discourse-cdn.com/v4/letter/l/ee59a6/32.png) [@LittleBoxes](https://discourse.processing.org/u/LittleBoxes)\
**Post date:** [June 7, 2019, 7:11pm UTC](https://discourse.processing.org/t/problem-with-socket-io/11907/1 "2019-06-07T19:11:52Z")

</div>

Hello,

II would like to use [socket.io](http://socket.io) to create a small multiplayer game.  
To try this lib, I try to install a Shared-canvas script found on the Coding Train site (tuto about websocket). It works well on a local server but not on a "external"server.

Would anyone ever experience [socket.io](http://socket.io) other than on a local server?  
I badly need help 😬

---

<div class="post-metadata">

**Author:** ![LittleBoxes](https://avatars.discourse-cdn.com/v4/letter/l/ee59a6/32.png) [@LittleBoxes](https://discourse.processing.org/u/LittleBoxes)\
**Post date:** [June 9, 2019, 11:54am UTC](https://discourse.processing.org/t/problem-with-socket-io/11907/2 "2019-06-09T11:54:11Z")

</div>

The problem seems to be come from CORS.  
Is anyone know how to deal with it ?

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [June 9, 2019, 2:02pm UTC](https://discourse.processing.org/t/problem-with-socket-io/11907/3 "2019-06-09T14:02:57Z")

</div>

> **[Allowing cross-origin use of images and canvas](https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image)**
>
> HTML provides a crossorigin attribute for images that, in combination with an appropriate CORS header, allows images defined by the img element that are loaded from foreign origins to be used in a canvas as if they had been loaded from the current...

---

<div class="post-metadata">

**Author:** ![LittleBoxes](https://avatars.discourse-cdn.com/v4/letter/l/ee59a6/32.png) [@LittleBoxes](https://discourse.processing.org/u/LittleBoxes)\
**Post date:** [June 9, 2019, 2:59pm UTC](https://discourse.processing.org/t/problem-with-socket-io/11907/4 "2019-06-09T14:59:28Z")

</div>

Thanks, but the problem is not with the image but with the data coming from a client, go to the server and then to the client two (and vice versa)

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [June 9, 2019, 4:22pm UTC](https://discourse.processing.org/t/problem-with-socket-io/11907/5 "2019-06-09T16:22:34Z")

</div>

Never dealt w/ server-side programming yet. 😣  
But if you control the server, you should be able to set it up CORS-free. 🆓
