HTTP 403 (Forbidden) when posting using personal IP/Port through Node JS

Hi.

I understand there are tons of other related posts, but I still need help. I am using my IP to send post requests from Roblox to my external web app/database and am just now continuously getting the “HTTP 403 (Forbidden)” error.

Just last night and this morning I was able to use the same exact path (IP/port) to successfully post to my database (EDIT: that still works). I want to send a post with the same IP/port, but to another endpoint (I think I used the term ‘endpoint’ correctly). What is wrong?

Roblox Script – This script executes once messaging service publishes (from open cloud API)

local foundPlayer = findPlayer();
		if not foundPlayer then
			local success, err = pcall(function()
				HttpService:PostAsync("http://IP:25565/v2", HttpService:JSONEncode({player = playerToKick}))
			end)
			if success then
				print("SENT")
			else
				print(err) -- this prints
			end
			return 
		end

JavaScript Script – This should be fired right before messaging service publishes
Code_bXnneQSYTJ

EDIT: If it helps figure out an answer at all, I was not sure if player kick prompts filter swearing (they don’t, you have to filter the reason before kicking) and tried it within a public server. Could roblox moderation have caught this before I implemented tagging and flagged by IP somehow for example?

Any help is greatly appreciated!

1 Like

What exactly are you trying to achieve here? Can you send a image that documents exactly what you want to happen?

1 Like

Nevermind. Assuming that, from the code you’ve proved, you want to do a sort of cross-platform messaging service, am i correct?

1 Like

That is correct. My goal is to make a simple discord bot which uses commands and messaging service to communicate with the servers.

Posting with the same URL DID work before. At least last night it did.

1 Like

Honestly, i’m stumped. I’ve never seen an issue like that…
Since i can’t help, i’d advise you to check similar posts to try to find a solution. Good luck with your creation!

1 Like

Well, thanks for the effort at least, haha.

2 Likes

The top (commented) IP works, but not the one below it…???

1 Like

Have you tested if your endpoint is actually working and responding correctly outside of Roblox Studio?

2 Likes

OK. So I figured out that the post requests probably work in studio only. Not sure why they are not working in a regular server.

When done in studio, I get the expected results from the app.

1 Like

Is your program running on your home network or on a VPS (/Dedicated Server)?

1 Like

Home network currently. I planned to put it on a virtual server when done. Will it only work on a virtual server?

1 Like

Nah, I doubt it, it should work perfectly fine on your PC.

Is the port open on your firewall? (In really simplified terms) If the port isn’t open, it means nothing from outside your network can connect to it, in this case, a Live Roblox server.

Assuming you’re on Windows, you should be able to open the port 25565 using the following command:

netsh advfirewall firewall add rule name="Allow Port 25565" dir=in action=allow protocol=TCP localport=25565

Once you’ve ran that, you can run the following command to see if the rule exists.

netsh advfirewall firewall show rule name=all

Let me know how it goes, you can also open the port via the control panel, if you’re not a fan of using terminal:

image

1 Like

Oh my gosh. I’ve done this type of stuff before but never thought to do it for this. I’ll give it a shot, thanks.

1 Like

It still has the same error. :confused:

1 Like

No worries!
Have you tried changing the port? 80 or 8080 are what most people would probably recommend for HTTP.

1 Like

I just tried. Now in studio, I get this: (it also happened with 25565 after firewall stuff)

RobloxStudioBeta_YATX38mTOa

Any error code is probably good, as long as it doesn’t time out it means your computer is responding to the request.

Since we’ve debugged that it’s not a problem with Roblox or your firewall, it is probably to do with your API handler/program.

I ended up fixing studio, no luck with public server.

I see. Do you have any advice on how I should go about fixing it? I’m using node express JS

This is the “module” I have for listening to the port and receiving post requests. It starts listening to port 8080 from the index file and eventually should work with the post function.

Code_I0AeeDcbNO

FIXED. For anyone with same or similar issues, make sure you:

  • Port Forward via firewall (and maybe router too, I did to be safe)
  • USE PUBLIC IPv4, NOT LOCAL/PRIVATE ONE (search on google “what is my public IP”) – fixed it for me
1 Like