Y
Y
ymenaidtopa2021-08-30 15:57:35
JavaScript
ymenaidtopa, 2021-08-30 15:57:35

How to get a reference to the so-called "socket"?

I'm setting up my application vk mini apps, and I can't understand what kind of "socket" it is and how to get a link to it, tell me, please

const connect = (data) => {
        window.socket = io.connect('ссылка на сокет', {
            autoConnect: false,
            secure: true,
            query: {
                "uid": data.id,
                "nick": data.first_name + ' ' + data.last_name,
                "photo": data.photo_200,
                "params": window.location.search.substring(1),
                'nowcode': uniquecode
            },
            transports: ['websocket']
        })
        events(window.socket)
        window.socket.connect()

    }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir, 2021-08-30
@ymenaidtopa

This is not a socket, but a server .

const socket = io(" https://server-domain.com ");

Use host by type
localhost:3000

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question