Roblox-Long-Polling A Node.JS Module to Make Real-Time Communication Easy [Scalable Version Now Available]

Alright I’ve stuck the example code into a Heroku dyno but it seems to have trouble connecting. It gives me this error when I run the game:


The Heroku dyno has no errors whatsoever.

Here is a GitHub repository with all the code in it:

It’s just a Heroku dyno with the provided example code and a bit of minor changes made to it.

I’m not too sure how the Heroku platform works, it’s very possible the Heroku instance is not constantly online, which is required by this app to keep a connection open. As well as you should have to define the port on line 4 in index.js that Heroku uses.

Alright, sounds good. I’ll try that.

It is now telling me that it cannot parse the JSON:


It’s further than I was before though, so thank you!

Make sure you didn’t include a / after the website… like https://google.com/ should be https://google.com
In your module

Actually you did that, looking at your site it shows this image Might want to pull you logs and see if there was an error. Also, don’t set port 80 in your module. Just set it to https://long-polling-rb.herokuapp.com/

How do I stop the Roblox side (Client) from continuing to run past the shutdown deadline?

I’ve discovered this bug and meant to push my fix to GitHub but I haven’t quite got around to it. Do me a favor and DM me here on the dev forum and remind me to do it.

Just did! Thanks for this library, as it truly is an excellent use for connecting between my Node.js backend API for my service and Roblox!

1 Like

Update! We had a bug rolled out where we were not decoding messages on the node-server end of things. This has since been fixed, if you are having issues where it’s not working just upgrade your back-end/node version and the issue should subside. Sorry for any inconvience.

yo i just found out about this and this seems pretty nice!!

i must ask tho, what is the license?
am i able to use it in commercial projects?
(also once again this was exactly what i was looking for lol)

I haven’t attached a license, as it’s open source. It’s free to use, commercially, publically, or in any way you want. We guarantee no warranties or any guarantees at that. You’re free to use it as you wish (as long as you are not claiming it as your own).

epic, thanks man

thisll help a lot with my ideas regarding remote stuff

Hey there! Awesome idea, I’ve thought of doing this for a bit of time, but you just saved my life, lol, mind if I take it and optimize it a little more?

He is using the MIT License, which means that he’s OK with people sharing modified source code, with some limitations. See this for an overview of the MIT License.

I know. I just want to be nice and ask first :slight_smile:

1 Like

Yes, you are okay to make modifications to the code. Thanks for asking!

Is there a python version of this? I’m currently struggling to make a system where the applications get sent through roblox to discord bot for review.

I don’t think so but it’s definitely possible to make one.

hey, I dont think :Disconnect() is working properly. I added a few print statements within the statement after the request is issued and they never fired. The Disconnect function also timeouts when given enough time.

edit: it was a spelling error within my program. I fixed it, however even upon disconnect the pings continue. This causes extremely long close times for servers. I am wondering if there is any way to disconnect 100% and stop pings so that servers can close easier.

edit 2: It seems the issue was on line 65 and 66 of the Connection ModuleScript.

game:BindToClose(close);
game.Close:Connect(close)

these bind this function to when the server closes:

local function close()
	HttpService:RequestAsync({
		Url = newConnection.url.."/connection/"..newConnection.id,
		Method = "DELETE",
	})
end

this RequestAsync is never satisfied and so it hangs permanently. I have 0 use for this bind to close as I disconnect all of my connections before the server shutdown in a seperate script so I just removed it. This made servers go from taking 20-30 seconds to close to taking under 1.

1 Like