offbynull / portmapper

Java library that maps ports on NAT-enabled routers (supported protocols: UPnP-IGD/NAT-PMP/PCP).
Apache License 2.0
88 stars 17 forks source link

PCP only version. #47

Closed stokito closed 2 years ago

stokito commented 2 years ago

I would like to have a minimal footprint for my app and honestly just afraid of UPnP. Could you make a separate artifact with the PCP only? The NATPMP is not needed honestly because the miniupnpd supports PCP for a long time already. Thank you

offbynull commented 2 years ago

Hey,

Don't use this. The project is unmaintained at this point, the code isn't great, and the PCP spec has likely changed since it came out. IIRC the spec had various extensions in review at the time, and there were talks of carrier-grade NATs supporting PCP. NATPMP was a simple protocol. PCP, if you include all of the extra stuff, didn't seem like a simple protocol.

When it comes to UPnP, its the ancient routers that you need to be worried about. More modern routers are all probably fine. Some routers may also have security features that won't let your software just open whatever ports it wants (user intervention may be required).

If you want to support PCP, miniupnpc has an implementation you can hook into. You'll need to call into it using JNI (or something equivalent) because it's a C library. I'm not sure what the situation is with Android.

stokito commented 2 years ago

Hi, it's sad to hear but still your library is used and eventually will get more attention, users and contributors. Interesting to hear that the PCP is somehow not so useful as the NATPMP. Here is another library author even decided not to support it https://github.com/jackpal/go-nat-pmp/issues/2