New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

django-ssh-tunnel-proxy

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

django-ssh-tunnel-proxy

A Django plugin that allows ssh remote tunnels.

  • 1.0.2
  • PyPI
  • Socket score

Maintainers
1

django-ssh-tunnel-proxy

Opens an ssh tunnel so your local development server can be accessed remotely

Quick start

  1. Install with pip install django-ssh-tunnel-proxy
  2. Add sshtunnelproxy to INSTALLED_APPS
  3. Set the settings described below
  4. Start a dev-server using python manage.py runserver
  5. Open a tunnel using python manage.py opensshtunnelproxy
  6. Visit the URL displayed in your terminal

Context manager

Create a temporary tunnel using the context manager

from sshtunnelproxy import tunnel

with tunnel() as remote_url:
    pass  # do something

Available settings

SSH_TUNNEL_USER: str = ''
"""The SSH user to use for the tunnel. default: `''`"""

SSH_TUNNEL_PASSWORD: str = ''
"""The SSH password to use for the tunnel. default: `''`"""

SSH_TUNNEL_PORT_RANGE: tuple[int, int] = (24000, 24999)
"""The range of ports to use for the tunnel. default: `(24000, 24999)`"""

SSH_TUNNEL_HOST: str = ''
"""The host to tunnel to. default: `''`"""

SSH_TUNNEL_URL_GENERATOR: Callable[[int], str] = lambda port: f"http://{SSH_TUNNEL_HOST}:{port + 1}"
"""
The function to generate the tunnel URL.
Takes the remote port as an argument and returns the URL at which the tunnel can be accessed.
default: `lambda port: f'http://{HOST}:{port + 1}'`
"""

Remote server

For this to work, you need a remote web server to reverse-proxy the tunneled port.

What else

Make sure to add SSH_TUNNEL_HOST to your ALLOWED_HOSTS.
Also, SESSION_COOKIE_SECURE = False must be set, or else you won't be able to log in.

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc