Skip to content

Allow custom low ports addition -p #339

Description

@jjtseng93
  • I'm here to provide a quick solution.
  • In case somebody urgently needs this
  • But since it is completely vide coded, it requires more testing to become solid
  • Attached below
  • the 1st one uses a PROOT_NETLINK_ROUTE=1 to return correct addresses
  • the 2nd one uses PROOT_PORT_ADD=3000 to pass a custom addition value

Problem description

  1. nodejs/bun os.networkInterfaces() returns system error 13
  2. proot -p not able to set custom addition values to achieve docker-like port mapping

Steps to reproduce

  1. pd login debian -> node -e "console.log(os.networkInterfaces())"
  2. LD_PRELOAD= proot -p -S /path/to/debian/rootfs /usr/bin/node -e "http.createServer((q,s)=>s.end('hello')).listen(80)"

Expected behavior

  1. Return IP addresses from different interfaces
  2. Have a custom option for adding to the original port

Additional information



patches.zip

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions