# Can I use different port for websocket comms

**URL:** <https://discourse.nodered.org/t/can-i-use-different-port-for-websocket-comms/17445>\
**Category:** General\
**Created:** [2 November 2019 22:23 UTC](https://discourse.nodered.org/t/can-i-use-different-port-for-websocket-comms/17445 "2019-11-02T22:23:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [2 November 2019 22:23 UTC](https://discourse.nodered.org/t/can-i-use-different-port-for-websocket-comms/17445/1 "2019-11-02T22:23:30Z")

</div>

You know the phrase - there's no such thing as a stupid question....

I know how to spell websickets but that's about as far as it goes but I've managed to get a Scratch extension to connect to a websocket listener (if thats the right terminology) running on Node-RED

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/e/e3bf2557c9fc49afe197cb7e7b749b91179ff3d2.png)

JS code in my Scratch3 extension

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/b/bdebaf2af310ee247cbe5a7a5d6f3c4694c6dc99.png)

Can I use a different socket from 1880?

Is so - whats the the syntax/config to change it to using port 9000?

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [2 November 2019 22:29 UTC](https://discourse.nodered.org/t/can-i-use-different-port-for-websocket-comms/17445/2 "2019-11-02T22:29:57Z")

</div>

No, you cannot. It only knows how to listen on the same server as Node-RED.

You could change Node-RED to listen on port 9000, but then you access it all on that port, including the editor. That's done via the settings file.

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [2 November 2019 22:34 UTC](https://discourse.nodered.org/t/can-i-use-different-port-for-websocket-comms/17445/3 "2019-11-02T22:34:03Z")

</div>

> [@knolleary](#):
>
> you could change Node-RED to listen on port 9000,

Ta 🙂  
I'll run up one of @TotallyInformation alternative instances running on 9000

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [2 November 2019 23:06 UTC](https://discourse.nodered.org/t/can-i-use-different-port-for-websocket-comms/17445/4 "2019-11-02T23:06:51Z")

</div>

RESULT 🙂

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/b/bb1c121923e3cb31b42859191879fc5e08a55757.png)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/8/87bb2a79272d88dfecbae0f2ebbd960f2f75769a.png)

---

<div class="post-metadata">

**Author:** ![Alacritous](https://avatars.discourse-cdn.com/v4/letter/a/9fc29f/32.png) [@Alacritous](https://discourse.nodered.org/u/Alacritous)\
**Post date:** [4 November 2019 16:00 UTC](https://discourse.nodered.org/t/can-i-use-different-port-for-websocket-comms/17445/5 "2019-11-04T16:00:37Z")

</div>

Is there a particular reason that you are using scratch and trying to connect it with NR? There is a blockly node available for NR that will allow you to use that programming interface directly in Node-red instead of a function node. Just FYI.

node-red-contrib-blockly

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [4 November 2019 16:48 UTC](https://discourse.nodered.org/t/can-i-use-different-port-for-websocket-comms/17445/6 "2019-11-04T16:48:35Z")

</div>

> [@Alacritous](#):
>
> Is there a particular reason that you are using scratch and trying to connect it with NR?

🙂

I've spent quite a considerable amount of my programming life using Scratch and developing extensions for it - see [simplesi.net](http://simplesi.net)

> [@Alacritous](#):
>
> node-red-contrib-blockly

I use it all the time in my flows 🙂

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/8/85f28a2a7853c02ec8ab0a2b3ead68783d27eb4d.png)
