2

How can I open specific ports in order to use a SDK for a project?

I have already tried netcat, but it seems that you can only listen to a specific port or open a specific port if you have a hosting website.

1
  • 2
    Please clarify your question. Are you asking how to get a server process listening on a particular port (if so, what kind of server software, etc), or how to prevent a firewall from blocking access to that port (in which case, what firewall, what's the network setup, etc)? Commented Jul 22, 2018 at 4:15

1 Answer 1

5

To open a port and keep listening on it, on macOS this should be working:

nc -lk 8080

To test you can connect to the opened port by doing:

nc -vt 0 8080

To use UDP, you just need to use option -u, for example:

nc -u -lk 8080

To test you can connect:

nc -u -vt 0 8080

Output:

found 0 associations
found 1 connections:
     1: flags=82<CONNECTED,PREFERRED>
        outif (null)
        src 127.0.0.1 port 63214
        dst 127.0.0.1 port 8080
        rank info not available

Connection to 0 port 8080 [udp/http-alt] succeeded!
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.