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

Lease times - is there a way to set an unlimited lease time? #49

Open risharde opened 5 months ago

risharde commented 5 months ago

Hi @offbynull , I've now discovered this android implementation and I was curious as to whether I can specify an unlimited lease time when mapping a port - it seems like the lease time is required by example mapper.mapPort() function

Can you advise me whether this is possible?

Thanks!

offbynull commented 5 months ago

Hey,

The library isn't maintained anymore. I need to update the readme to reflect that. I suspect there are much better (and newer) libraries available that have Android support.

But, to answer your question, if I recall correctly unlimited leases weren't supported across all protocols. Even if they were, an unlimited lease will end up lingering if your application crashes, which I suspect many people won't like.

On Wed, Mar 27, 2024, 4:53 PM risharde @.***> wrote:

Hi @offbynull https://github.com/offbynull , I've now discovered this android implementation and I was curious as to whether I can specify an unlimited lease time when mapping a port - it seems like the lease time is required by example mapper.mapPort() function

Can you advise me whether this is possible?

Thanks!

— Reply to this email directly, view it on GitHub https://github.com/offbynull/portmapper/issues/49, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQPQIWC53UFZBDGNVHC5J3Y2MWTNAVCNFSM6AAAAABFLT3RYWVHI2DSMVQWIX3LMV43ASLTON2WKOZSGIYTCOBYHAYDOMA . You are receiving this because you were mentioned.Message ID: @.***>

risharde commented 5 months ago

Thanks for the response! Really appreciate it! I have been looking at other libraries and thought I understood yours the best out of them - new is ironicly not what I am looking for since I need something that works with as low as android 5. Your library has helped alot so far!

On Wed, Mar 27, 2024, 9:40 PM Kasra Faghihi @.***> wrote:

Hey,

The library isn't maintained anymore. I need to update the readme to reflect that. I suspect there are much better (and newer) libraries available that have Android support.

But, to answer your question, if I recall correctly unlimited leases weren't supported across all protocols. Even if they were, an unlimited lease will end up lingering if your application crashes, which I suspect many people won't like.

On Wed, Mar 27, 2024, 4:53 PM risharde @.***> wrote:

Hi @offbynull https://github.com/offbynull , I've now discovered this android implementation and I was curious as to whether I can specify an unlimited lease time when mapping a port - it seems like the lease time is required by example mapper.mapPort() function

Can you advise me whether this is possible?

Thanks!

— Reply to this email directly, view it on GitHub https://github.com/offbynull/portmapper/issues/49, or unsubscribe < https://github.com/notifications/unsubscribe-auth/ABQPQIWC53UFZBDGNVHC5J3Y2MWTNAVCNFSM6AAAAABFLT3RYWVHI2DSMVQWIX3LMV43ASLTON2WKOZSGIYTCOBYHAYDOMA>

. You are receiving this because you were mentioned.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/offbynull/portmapper/issues/49#issuecomment-2024247360, or unsubscribe https://github.com/notifications/unsubscribe-auth/AICMFI7FRGBJI44ESU3X3YLY2NYJRAVCNFSM6AAAAABFLT3RYWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRUGI2DOMZWGA . You are receiving this because you authored the thread.Message ID: @.***>

offbynull commented 5 months ago

The problem with the library is that it lacks support for various protocol extensions. For example, PCP has a bunch of additional RFCs and some security things are missing for upnp-igd. There are a broad range of scenarios where the library simply won't work, and I don't have the capacity to keep it up to date (or even maintained).

It may be better for you to invest the time into porting minupnpc from C to Java (or Kotlin or whatever). I suspect modern LLMs like ChatGPT4 / Claude3 Opus will take out much of the grunt work.

On Thu, Mar 28, 2024, 2:17 AM risharde @.***> wrote:

Thanks for the response! Really appreciate it! I have been looking at other libraries and thought I understood yours the best out of them - new is ironicly not what I am looking for since I need something that works with as low as android 5. Your library has helped alot so far!

On Wed, Mar 27, 2024, 9:40 PM Kasra Faghihi @.***> wrote:

Hey,

The library isn't maintained anymore. I need to update the readme to reflect that. I suspect there are much better (and newer) libraries available that have Android support.

But, to answer your question, if I recall correctly unlimited leases weren't supported across all protocols. Even if they were, an unlimited lease will end up lingering if your application crashes, which I suspect many people won't like.

On Wed, Mar 27, 2024, 4:53 PM risharde @.***> wrote:

Hi @offbynull https://github.com/offbynull , I've now discovered this android implementation and I was curious as to whether I can specify an unlimited lease time when mapping a port - it seems like the lease time is required by example mapper.mapPort() function

Can you advise me whether this is possible?

Thanks!

— Reply to this email directly, view it on GitHub https://github.com/offbynull/portmapper/issues/49, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/ABQPQIWC53UFZBDGNVHC5J3Y2MWTNAVCNFSM6AAAAABFLT3RYWVHI2DSMVQWIX3LMV43ASLTON2WKOZSGIYTCOBYHAYDOMA>

. You are receiving this because you were mentioned.Message ID: @.***>

— Reply to this email directly, view it on GitHub < https://github.com/offbynull/portmapper/issues/49#issuecomment-2024247360>,

or unsubscribe < https://github.com/notifications/unsubscribe-auth/AICMFI7FRGBJI44ESU3X3YLY2NYJRAVCNFSM6AAAAABFLT3RYWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRUGI2DOMZWGA>

. You are receiving this because you authored the thread.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/offbynull/portmapper/issues/49#issuecomment-2024477735, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQPQIRM7Z242Y6U7DW7NXDY2OYXDAVCNFSM6AAAAABFLT3RYWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRUGQ3TONZTGU . You are receiving this because you were mentioned.Message ID: @.***>