pyservx 1.0.1__py3-none-any.whl → 1.0.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of pyservx might be problematic. Click here for more details.

pyservx/server.py CHANGED
@@ -214,7 +214,7 @@ class FileRequestHandler(http.server.SimpleHTTPRequestHandler):
214
214
  }}
215
215
 
216
216
  .glitch {{
217
- position: relative;
217
+ position: relative.
218
218
  animation: glitch 2s infinite;
219
219
  }}
220
220
 
@@ -567,29 +567,28 @@ class FileRequestHandler(http.server.SimpleHTTPRequestHandler):
567
567
  return
568
568
 
569
569
  def get_ip_addresses():
570
- """Retrieve all non-loopback IPv4 addresses of the system."""
571
- ip_addresses = []
570
+ """Retrieve all non-loopback and loopback IPv4 addresses of the system."""
571
+ ip_addresses = ["127.0.0.1"] # Explicitly include localhost
572
572
  try:
573
573
  # Get all network interfaces, filter for IPv4 (AF_INET)
574
574
  for interface in socket.getaddrinfo(socket.gethostname(), None, socket.AF_INET):
575
575
  ip = interface[4][0]
576
- # Filter out loopback (127.x.x.x) and link-local (169.254.x.x)
577
- if not ip.startswith("127.") and not ip.startswith("169.254."):
576
+ # Filter out link-local (169.254.x.x) but keep 127.x.x.x
577
+ if not ip.startswith("169.254.") and ip not in ip_addresses:
578
578
  ip_addresses.append(ip)
579
- return ip_addresses if ip_addresses else ["No IPv4 addresses found"]
579
+ return ip_addresses if ip_addresses else ["127.0.0.1", "No other IPv4 addresses found"]
580
580
  except socket.gaierror:
581
- return ["Unable to resolve hostname"]
581
+ return ["127.0.0.1", "Unable to resolve hostname"]
582
582
 
583
583
  def run(base_dir):
584
584
  """Run the HTTP server with the specified base directory."""
585
- # Set up the server with the base directory
586
585
  class Handler(FileRequestHandler):
587
586
  def __init__(self, *args, **kwargs):
588
587
  self.base_dir = base_dir
589
588
  super().__init__(*args, **kwargs)
590
589
 
591
590
  # Print IP addresses before starting the server
592
- print("System IPv4 addresses:")
591
+ print("System IPv4 addresses (including localhost):")
593
592
  for ip in get_ip_addresses():
594
593
  print(f" http://{ip}:{PORT}")
595
594
 
@@ -597,7 +596,7 @@ def run(base_dir):
597
596
 
598
597
  try:
599
598
  server = socketserver.ThreadingTCPServer(("0.0.0.0", PORT), Handler)
600
- print(f"Serving at http://0.0.0.0:{PORT} (accessible from network)")
599
+ print(f"Serving at http://0.0.0.0:{PORT} (accessible from network and localhost)")
601
600
 
602
601
  def shutdown_handler(signum, frame):
603
602
  print("\nShutting down server...")
@@ -629,7 +628,7 @@ def run(base_dir):
629
628
  def main():
630
629
  """Main entry point for the command-line tool."""
631
630
  parser = argparse.ArgumentParser(description="PyServeX: A simple HTTP server for file sharing.")
632
- parser.add_argument('--version', action='version', version='PyServeX 1.0.0')
631
+ parser.add_argument('--version', action='version', version='PyServeX 1.0.1')
633
632
  args = parser.parse_args()
634
633
 
635
634
  # Get the shared folder
@@ -0,0 +1,72 @@
1
+ Metadata-Version: 2.4
2
+ Name: pyservx
3
+ Version: 1.0.4
4
+ Summary: A simple Python server package
5
+ Author-email: Your Name <your.email@example.com>
6
+ License: MIT License
7
+
8
+ Copyright (c) 2025 SubZ3r0x01
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
15
+ Project-URL: Homepage, https://github.com/yourusername/pyservx
16
+ Project-URL: Repository, https://github.com/yourusername/pyservx
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: License :: OSI Approved :: MIT License
19
+ Classifier: Operating System :: OS Independent
20
+ Requires-Python: >=3.6
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ Dynamic: license-file
24
+
25
+ # PyServeX
26
+
27
+ A simple HTTP server for file sharing with a retro-styled web interface.
28
+
29
+ ## Installation
30
+
31
+ Install using pip:
32
+
33
+ ```bash
34
+ pip install pyservx
35
+ ```
36
+
37
+ Or use pipx for an isolated environment (recommended for Linux):
38
+
39
+ ```bash
40
+ pipx install pyservx
41
+ ```
42
+
43
+ Ensure you have Python 3.6 or higher installed.
44
+
45
+ ## Usage
46
+
47
+ Run the server:
48
+
49
+ ```bash
50
+ pyservx
51
+ ```
52
+
53
+ - Follow the prompt to select a shared folder.
54
+ - The server will start at `http://localhost:8088` and other network IPs.
55
+ - Access the web interface to browse, download, or upload files.
56
+ - Use `Ctrl+C` to stop the server.
57
+
58
+ ## Features
59
+
60
+ - File and folder browsing with a retro "hacker" UI.
61
+ - Download entire folders as ZIP files.
62
+ - Upload files via the web interface.
63
+ - Accessible via localhost (`127.0.0.1`) and network IPs.
64
+
65
+ ## Requirements
66
+
67
+ - Python 3.6+
68
+ - No external dependencies
69
+
70
+ ## License
71
+
72
+ MIT License
@@ -0,0 +1,8 @@
1
+ pyservx/__init__.py,sha256=P46sCZCW1SAUson0VT-PllU42gLB5p1DFWEt12Kdn38,43
2
+ pyservx/server.py,sha256=V7MSs3HNC4PZ7rwKDFQURQyvaUFv_x31UFjawz_G_NU,21948
3
+ pyservx-1.0.4.dist-info/licenses/LICENSE,sha256=RQfbbgFORXVcSaR2_p6XSOR7k0yw1iGfpnW7mg1NW9c,1074
4
+ pyservx-1.0.4.dist-info/METADATA,sha256=d6dowSd2X4CbiY6O2Jvl-HSFNNOqIp0XIoCB9LWspSc,2595
5
+ pyservx-1.0.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
6
+ pyservx-1.0.4.dist-info/entry_points.txt,sha256=tRdMhIAJUa2bpIJ5h9ZkKPdSSp8fnYlPDGcJhdh01TY,48
7
+ pyservx-1.0.4.dist-info/top_level.txt,sha256=lns7pTcCmrrfUXLVStCYJVqE6lglEqT1xABDpuTEF-Y,8
8
+ pyservx-1.0.4.dist-info/RECORD,,
@@ -1,4 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.27.0
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
+
@@ -0,0 +1 @@
1
+ pyservx
@@ -1,16 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: pyservx
3
- Version: 1.0.1
4
- Summary: A simple HTTP server for file sharing with folder zipping and file upload capabilities
5
- Author-email: SubZ3r0x01 <your.email@example.com>
6
- License: MIT License
7
-
8
- Copyright (c) 2025 SubZ3r0x01
9
-
10
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
15
- License-File: LICENSE
16
- Requires-Python: >=3.6
@@ -1,7 +0,0 @@
1
- pyservx/__init__.py,sha256=P46sCZCW1SAUson0VT-PllU42gLB5p1DFWEt12Kdn38,43
2
- pyservx/server.py,sha256=cyowYkXVR3PhffeNVO5YKb4UYYmDwAIEmRhOwN5ENtA,21882
3
- pyservx-1.0.1.dist-info/METADATA,sha256=1p3PW36RHHyRFLdkE1DGo10SHqW68KIN4Irsh6BacMY,1382
4
- pyservx-1.0.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
5
- pyservx-1.0.1.dist-info/entry_points.txt,sha256=tRdMhIAJUa2bpIJ5h9ZkKPdSSp8fnYlPDGcJhdh01TY,48
6
- pyservx-1.0.1.dist-info/licenses/LICENSE,sha256=RQfbbgFORXVcSaR2_p6XSOR7k0yw1iGfpnW7mg1NW9c,1074
7
- pyservx-1.0.1.dist-info/RECORD,,