Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/perfecto25/portela
quick and simple python based webserver to test port connectivity
https://github.com/perfecto25/portela
Last synced: 7 days ago
JSON representation
quick and simple python based webserver to test port connectivity
- Host: GitHub
- URL: https://github.com/perfecto25/portela
- Owner: perfecto25
- Created: 2018-10-30T14:29:03.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-05-24T13:48:34.000Z (over 2 years ago)
- Last Synced: 2024-04-28T23:24:27.744Z (7 months ago)
- Language: Python
- Size: 369 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Portela
![](portela.jpg)
## a simple port allocator
Portela is a Python 2 & 3 compatible port allocator with zero dependencies.
Portela can be used to test basic port connectivity on your host and lets you open up ports on various network interfaces.
You can do the same functions with netcat, SimpleHTTPServer, socat and various other tools, but Portela is more user-friendly and offers a simple way to bind to various network interfaces.
Python compatibility: 2.7.x - 3.8.x
Platform compatibility: Linux
### usage:
```
# portela serve 1234 // spin up a listener on port 1234
# portela serve 1234 -i eth1 // spins up on port 1234 on interface 'eth1'
# portela serve 1234 -i eth1 -d // spins up on port 1234 on interface 'eth1' and run as daemon
# portela serve 1234 -m "samba magic" // spins up on port 1234 and return a message on HTTP call
# portela stop // stops all instances of portela listerner
# portela status // check if portela is running as daemon
# portela help / -h / --help // prints this message
```### Install
pip install portela
### Testing
Local testingsudo pip install -e /path/to/portela
### Daemon
When Portela puts the listener in background as daemon, it creates a PID file (.portela.pid) in /home/user directoryDaemon functions are taken from this article: https://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/