Skip to main content

Port forwarding manager

Project description

Port Forward Manager (PFM)

PFM allows quick and easy management of ports forwarded over SSH (local or remote).

Installation

# Install tmux
brew install tmux
# Install python poetry https://python-poetry.org/docs/
brew install poetry
or
curl -sSL https://install.python-poetry.org | python3 -

# Install PFM
pip install --upgrade port-forward-manager

# If you get the error "This environment is externally managed" then you can do:
# find /opt/homebrew -name EXTERNALLY-MANAGED
# 
# With the file that was found you just have to delete it or change the name like:
# sudo mv /opt/homebrew/Cellar/python@3.12/3.12.5/Frameworks/Python.framework/Versions/3.12/lib/python3.12/EXTERNALLY-MANAGED /opt/homebrew/Cellar/python@3.12/3.12.5/Frameworks/Python.framework/Versions/3.12/lib/python3.12/EXTERNALLY-MANAGED.old

Settings file is stored in ~/.ssh/pfm.settings.yaml

Configure autocomplete

Add to end of ~/.zshrc

fpath+=~/.zfunc

autoload -Uz compinit
compinit
zstyle ':completion:*' menu select

Generate autocomplete configuration

pfm --install-completion

# If gives error: ModuleNotFoundError: No module named 'pkg_resources'
# Run: pip3 install setuptools

source .zshrc

About

Settings

PFM will automatically generate a default configuration file and update new settings to their default values.

show_schema_link

Toggle the ability to show/hide the schema when showing the list of schemas.

wait_after_start

How long, in seconds, to wait after starting sessions.

table_border

Toggle the table border

show_pid

Toggle the screen PID

Example settings file:

schemas:
    local_proxy:
      - hostname: some.proxy.host
        remote_port: 8888
        type: local
    remote-server:
      - hostname: example.host
        local_port: 1234
        remote_port: 8080
        type: local
      - hostname: example.host
        local_port: 8888
        remote_port: 8888
        type: local
show_pid: 'false'
show_schema_link: 'false'
table_border: 'true'
wait_after_start: '0.5'
wait_after_stop: 0.5

Commands

config

Show active sessions

forward

Start a forwarding session

schemas

List configured schemas

shutdown

Stop all active sessions

start

Start a schema of forwarding sessions

status

Show active sessions

stop

Stop sessions from active schema, host or port ###version Show installed version

Development

Setup development environment

git clone git@github.com:kxiros/port-forward-manager.git
cd port-forward-manager
poetry shell
poetry install

Building python package

python -m build

To Install development version:

pip install -e cloned_directory_path

Release

#Example to github
gh release create 1.3 dist/port-forward-manager-1.3.tar.gz -t "Minor fixes" --generate-notes

#Publish on Pypi
# Configure pypi token
# poetry config pypi-token.pypi <token>
poetry publish

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

port_forward_manager-4.0.1.tar.gz (14.6 kB view details)

Uploaded Source

Built Distribution

port_forward_manager-4.0.1-py3-none-any.whl (19.0 kB view details)

Uploaded Python 3

File details

Details for the file port_forward_manager-4.0.1.tar.gz.

File metadata

  • Download URL: port_forward_manager-4.0.1.tar.gz
  • Upload date:
  • Size: 14.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.6 Darwin/23.6.0

File hashes

Hashes for port_forward_manager-4.0.1.tar.gz
Algorithm Hash digest
SHA256 29fcbc184029513c1e26267e4b61970dc363f1d7999179948405caf2f4939bdb
MD5 ce043bc1e9354c24e5ed1bda5ef35f86
BLAKE2b-256 bdd6c571a2e0a6bc1ff021c02a7746806c03de833e595c887bac11f26f4f64a7

See more details on using hashes here.

File details

Details for the file port_forward_manager-4.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for port_forward_manager-4.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 49b802348799a3b1504fb06227fdc89dd1ba90928c9c814a90dcbbe9a1bfa956
MD5 91739d3bf4d2c870b9a0f7d6df68a801
BLAKE2b-256 c1a8d4312df6e0635074c68a00f491f14f125ed8b3a286f49c53bf1ce6fd1e9c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page