# Connect to socket.io server with token

**URL:** <https://discourse.nodered.org/t/connect-to-socket-io-server-with-token/53822>\
**Category:** General\
**Created:** [16 November 2021 11:15 UTC](https://discourse.nodered.org/t/connect-to-socket-io-server-with-token/53822 "2021-11-16T11:15:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![olegunnardahle](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/olegunnardahle/32/51145_2.png) [@olegunnardahle](https://discourse.nodered.org/u/olegunnardahle)\
**Post date:** [16 November 2021 11:15 UTC](https://discourse.nodered.org/t/connect-to-socket-io-server-with-token/53822/1 "2021-11-16T11:15:43Z")

</div>

Hi

I'm trying to connect to a [socket.io](http://socket.io) server with a token

```auto
async function connectToSocket(token){
    var socket = require('socket.io-client')(`https://kong.tls.ai/bt/api/socket.io/?token=${token}`)
        socket.on('connect',onConnect)

```

I have tried to find a node that supports this, but I can't find any that supports authentication.

Has anyone solved this? Or do I have to learn javascript to make it?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [15 January 2022 11:15 UTC](https://discourse.nodered.org/t/connect-to-socket-io-server-with-token/53822/2 "2022-01-15T11:15:48Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
