# How to create a websocket server plugin and run Photoshop API through client

**URL:** <https://forums.creativeclouddeveloper.com/t/how-to-create-a-websocket-server-plugin-and-run-photoshop-api-through-client/7423>\
**Category:** Photoshop\
**Tags:** uxp\
**Created:** [January 26, 2024, 10:25am UTC](https://forums.creativeclouddeveloper.com/t/how-to-create-a-websocket-server-plugin-and-run-photoshop-api-through-client/7423 "2024-01-26T10:25:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Posheng](https://avatars.discourse-cdn.com/v4/letter/p/9e8a1a/32.png) [@Posheng](https://forums.creativeclouddeveloper.com/u/Posheng)\
**Post date:** [January 26, 2024, 10:25am UTC](https://forums.creativeclouddeveloper.com/t/how-to-create-a-websocket-server-plugin-and-run-photoshop-api-through-client/7423/1 "2024-01-26T10:25:19Z")

</div>

Hi,  
I need to know how to create a websocket server as UXP plugin being launched by photoshop. Therefore, I could use client to send message to server for executing the Photoshop API!!

---

<div class="post-metadata">

**Author:** ![Jarda](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/jarda/32/1909_2.png) [@Jarda](https://forums.creativeclouddeveloper.com/u/Jarda)\
**Post date:** [January 26, 2024, 3:02pm UTC](https://forums.creativeclouddeveloper.com/t/how-to-create-a-websocket-server-plugin-and-run-photoshop-api-through-client/7423/2 "2024-01-26T15:02:30Z")

</div>

UXP can’t do WS server. It can do only client.

---

<div class="post-metadata">

**Author:** ![Posheng](https://avatars.discourse-cdn.com/v4/letter/p/9e8a1a/32.png) [@Posheng](https://forums.creativeclouddeveloper.com/u/Posheng)\
**Post date:** [January 29, 2024, 3:41am UTC](https://forums.creativeclouddeveloper.com/t/how-to-create-a-websocket-server-plugin-and-run-photoshop-api-through-client/7423/3 "2024-01-29T03:41:12Z")

</div>

Thanks for your replying.  
So I guess I need to find another way to do this.

---

<div class="post-metadata">

**Author:** ![Posheng](https://avatars.discourse-cdn.com/v4/letter/p/9e8a1a/32.png) [@Posheng](https://forums.creativeclouddeveloper.com/u/Posheng)\
**Post date:** [January 31, 2024, 3:12am UTC](https://forums.creativeclouddeveloper.com/t/how-to-create-a-websocket-server-plugin-and-run-photoshop-api-through-client/7423/4 "2024-01-31T03:12:57Z")

</div>

I try to use [Socket.io](http://Socket.io) to create a socket port while loading my plugin.

> First question about “How to correct import or require module”:  
> **When I tried this** :  
> _const { Server } = require(“[socket.io](http://socket.io)”);_ --\>\>\>_Error: Module not found: “[socket.io](http://socket.io)”. Parent module folder was: “./”_  
> **When I tried this :**  
> _import “@socket.io”_ --\>\>\>_Cannot use import statement outside a module_

> Second question:  
> What if [socket.io](http://socket.io) and websocket are not current support in UXP, how to open a port to do the way like my CEP extension?
