Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow closing listener in port forwarding #324

Merged
merged 2 commits into from
Jan 24, 2024

Conversation

fish-sauce
Copy link
Contributor

Why

Whenever the go-ios is used as a dependency package in any go project, it would be nice to use port forwarding feature with the possibility to free the listening port when the forwarding is stopped

How

  • wrap the net.Listener in a dedicated struct
  • provide the Close() function to free the listening port
  • allow the eternal for loop in connectionAccept to break when Close() is called
  • wrap any errors occurred

ios/forward/forward.go Outdated Show resolved Hide resolved
ios/forward/forward.go Show resolved Hide resolved
@dmissmann dmissmann merged commit 81de99f into danielpaulus:main Jan 24, 2024
2 checks passed
diegoperini pushed a commit that referenced this pull request Feb 15, 2024
commit 60fdc02
Merge: ca960b1 7faba25
Author: David Missmann <[email protected]>
Date:   Thu Feb 15 11:29:00 2024 +0100

    Merge remote-tracking branch 'origin/main' into ios-17

commit 7faba25
Author: danielpaulus <[email protected]>
Date:   Wed Feb 14 21:57:31 2024 +0100

    iOS17 Linux Driver (#334)

    * add cdc-ncm user space driver for Linux

    ---------

    Co-authored-by: dmissmann <[email protected]>

commit ca960b1
Author: David Missmann <[email protected]>
Date:   Wed Feb 14 12:18:30 2024 +0100

    Merge main branch into ios-17

commit ce74125
Author: dmissmann <[email protected]>
Date:   Tue Feb 13 22:09:48 2024 +0100

    Start QUIC tunnels on iOS 17 (#341)

    The tunnel start command pairs with connected devices (manual pairing) and starts a tunnel for each device. The tunnel parameters (device address and the port for remote service discovery) are exposed via an HTTP-API locally so that other commands can access them without the need to pass those values manually (which is still possible if one wants/needs to use a tunnel created by MacOS)

    ---------

    Co-authored-by: danielpaulus <[email protected]>

commit 195efcb
Merge: dd4454c 8b51aa3
Author: Nikola Shabanov <[email protected]>
Date:   Fri Feb 9 18:41:22 2024 +0200

    Merge pull request #343 from danielpaulus/update-prepare-skip-keys

    Update and reorder prepare skip keys

commit 8b51aa3
Author: shamanec <[email protected]>
Date:   Fri Feb 9 18:14:01 2024 +0200

    update and reorder skip keys

commit dd4454c
Author: dmissmann <[email protected]>
Date:   Wed Feb 7 13:29:20 2024 +0100

    prepare iOS 17: Http2, RemoteXpc and device discovery (#337)

    Those changes don't add much functionality yet, but they are required later for connecting to RemoteXPC services on iOS 17 devices

    Co-authored-by: Diego Perini <[email protected]>
    Co-authored-by: danielpaulus <[email protected]>

commit bddd195
Author: Diego Molina <[email protected]>
Date:   Wed Feb 7 12:20:03 2024 +0100

    Adding Sauce to the readme (#338)

commit 81de99f
Merge: a49a358 aee8109
Author: dmissmann <[email protected]>
Date:   Wed Jan 24 10:37:56 2024 +0100

    Merge pull request #324 Allow closing listener in port forwarding

    Whenever the go-ios is used as a dependency package in any go project, it would be nice to use port forwarding feature with the possibility to free the listening port when the forwarding is stopped

commit aee8109
Author: Victor Kachalov <[email protected]>
Date:   Thu Jan 18 10:02:10 2024 +0100

    Add doc to Close listener in forward.go

    Co-authored-by: dmissmann <[email protected]>

commit 2d3af75
Author: fish-sauce <[email protected]>
Date:   Wed Jan 10 11:45:35 2024 +0100

    Allow closing listener in port forwarding
dmissmann added a commit that referenced this pull request Feb 16, 2024
commit b4506e7
Author: danielpaulus <[email protected]>
Date:   Fri Feb 16 08:28:32 2024 +0100

    Add usb muxd dockerfile (#351)

    * add dockerfile to build usbmuxd

commit 2d2d6fd
Author: danielpaulus <[email protected]>
Date:   Thu Feb 15 22:39:38 2024 +0100

    Add configure step (#349)

    add golang based configure steps to check deps before running make

commit e978449
Author: danielpaulus <[email protected]>
Date:   Thu Feb 15 22:36:09 2024 +0100

    add dockerfile to build usbmuxd (#350)

    Dockerfile for building latest usbmuxd

commit 1f77552
Author: Diego Perini <[email protected]>
Date:   Thu Feb 15 14:11:55 2024 +0300

    Added missing coredevice package

commit 2f5c456
Author: Diego Perini <[email protected]>
Date:   Thu Feb 15 14:06:59 2024 +0300

    Added appservice

commit e1daec3
Author: dmissmann <[email protected]>
Date:   Thu Feb 15 20:42:01 2024 +0100

    Skip TLS certificate verification for getting the developer disk signature (#348)

    * gs.apple.com does not have a certificate that is trusted on Linux hosts

    * set a timeout for getting the signature

commit 7faba25
Author: danielpaulus <[email protected]>
Date:   Wed Feb 14 21:57:31 2024 +0100

    iOS17 Linux Driver (#334)

    * add cdc-ncm user space driver for Linux

    ---------

    Co-authored-by: dmissmann <[email protected]>

commit ce74125
Author: dmissmann <[email protected]>
Date:   Tue Feb 13 22:09:48 2024 +0100

    Start QUIC tunnels on iOS 17 (#341)

    The tunnel start command pairs with connected devices (manual pairing) and starts a tunnel for each device. The tunnel parameters (device address and the port for remote service discovery) are exposed via an HTTP-API locally so that other commands can access them without the need to pass those values manually (which is still possible if one wants/needs to use a tunnel created by MacOS)

    ---------

    Co-authored-by: danielpaulus <[email protected]>

commit 195efcb
Merge: dd4454c 8b51aa3
Author: Nikola Shabanov <[email protected]>
Date:   Fri Feb 9 18:41:22 2024 +0200

    Merge pull request #343 from danielpaulus/update-prepare-skip-keys

    Update and reorder prepare skip keys

commit 8b51aa3
Author: shamanec <[email protected]>
Date:   Fri Feb 9 18:14:01 2024 +0200

    update and reorder skip keys

commit dd4454c
Author: dmissmann <[email protected]>
Date:   Wed Feb 7 13:29:20 2024 +0100

    prepare iOS 17: Http2, RemoteXpc and device discovery (#337)

    Those changes don't add much functionality yet, but they are required later for connecting to RemoteXPC services on iOS 17 devices

    Co-authored-by: Diego Perini <[email protected]>
    Co-authored-by: danielpaulus <[email protected]>

commit bddd195
Author: Diego Molina <[email protected]>
Date:   Wed Feb 7 12:20:03 2024 +0100

    Adding Sauce to the readme (#338)

commit 81de99f
Merge: a49a358 aee8109
Author: dmissmann <[email protected]>
Date:   Wed Jan 24 10:37:56 2024 +0100

    Merge pull request #324 Allow closing listener in port forwarding

    Whenever the go-ios is used as a dependency package in any go project, it would be nice to use port forwarding feature with the possibility to free the listening port when the forwarding is stopped

commit aee8109
Author: Victor Kachalov <[email protected]>
Date:   Thu Jan 18 10:02:10 2024 +0100

    Add doc to Close listener in forward.go

    Co-authored-by: dmissmann <[email protected]>

commit 2d3af75
Author: fish-sauce <[email protected]>
Date:   Wed Jan 10 11:45:35 2024 +0100

    Allow closing listener in port forwarding
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants