Connectivity Problem with Minecraft - Can't connect to neoforge server (but will connect to vanilla)

System Information

Field Value
Operating System Linux - Debian GNU/Linux 13 on x86_64
Product AMP ‘Phobos’ v2.6.5.2 (Mainline)
Virtualization Docker
Application Minecraft
Module MinecraftModule
Running in Container Yes
Current State Stopped

Problem Description

Issue

So I’ve been struggling with this for hours and I can’t get it to work. I’m trying to get NeoForge to run on it, specifically version 21.1.219. (I have the same client installed)

When I run the server on vanilla, it works. But when I change it to NeoForge it doen’t seem to connect to the server, even though the server is online. I get the error code:
getsockopt

Just to be clear, when I run it on vanilla I can connect with no issues.
When I switch it to NeoForge, it runs the server but does not let me connect.

Reproduction Steps

    1. Open minecraft neoforge 21.1.219 client
    1. Add a new multiplayer server on minecraft with the ip: srv1332476.hstgr.cloud:25565
    1. It should say: getsockopt. even though the server is online on hostinger

EDIT:

Fixed the issue by finding the VPS on hostinger and adding the port to it!

i was having the same issue and you should use the IPV4 adress to connect it worked for me and my friend