intergram
intergram copied to clipboard
socket.io problem
Dear community,
could anyone please tell me, how to configure socket.io when self-hosting this service? And where the files should be located? Because node projects shouldn’t be in the document root.
I’m getting one of these errors:
-
GET https://server_url/socket.io/?EIO=3&transport=polling&t=LmqFgWp 404 (Not Found)
-
using a rewrite rule
RewriteRule ^socket\.io(.*)? http://localhost:61148%{REQUEST_URI} [P]
WebSocket connection to 'wss://server_url/socket.io/?EIO=3&transport=websocket&sid=some-ID-foo' failed: Error during WebSocket handshake: Unexpected response code: 400
I’m using this variable: window.intergramServer = window.location.origin + "/hook";
which resolves to my-domain.com/hook—is this correct?
And how does the webhook need to be set up? To e.g. https://api.telegram.org/botxxx:yyy/setWebhook?url=my-domain.com/livechat/hook
or do you specify a protocol, too, like in https://api.telegram.org/botxxx:yyy/setWebhook?url=https://my-domain.com/livechat/hook
Hi I have the same , could any one help us? Thanks
I will need more information to help, but few points -
This is the right wss url structure -
wss://www.intergram.xyz/socket.io/?EIO=3&transport=websocket&sid=SOME-ID
Did you enabled SSLon your server? Did you pass the SSL certificate to the node process? This requires some changes to the server.js file.
Also when pointing to server url from the web (window.intergramServer
), do not point to the /hook
endpoint. The /hook
endpoint is used only by Telegram to pass messages from the admin to the server (which handles them and sends them to the web chat if needed)
So please share more information about the steps you have taken so far and the current situation (You can also email me - ido.mapchat at gmail dot com)
Thanks for your response I've just set bot_token and set telegram web-hook for my bot and build ...
1- Did you enabled SSL on your server? yes 2- Did you pass the SSL certificate to the node process? how ?!
Hi @mvardin the server.js file needs to be changed to use an https server instead of http and to use the server's private key and certificate.
Start by looking at this example, and see if that works for you.