Skip to main content

A fake server than catch all path and response success message or whatever data you defined.

Usage

python -m fake_server Success!

Then you can access whatever path in 'http://127.0.0.1' (such as http://127.0.0.1/simple/a/b/c), and then get response text 'Success!'.

All arguments:

python -m fake_server -t TEXT -f FILE_PATH -fc FILE_PATH -b 127.0.0.1:80

SERVER ARGUMENTS

  • -b --bind: Server bind host and port, default 127.0.0.1:80, if you what listen on all interface just use 0.0.0.0:80
  • -p --port: Server bind port, same as port in --bind

RESPONSE ARGUMENTS

You can only choice one argument for response

  • -t --text: Return text, default Success
  • -f --file FILE_PATH: Return file as attachment
  • -fc --file_content FILE_PATH: Return file content

Why you need this?

When you notice some software send your private data to their server(like: http://data.old_server.com ), and the software need success response from server(like: {"result": "success"}), what can you do? Now ,with fake_server, you can do like this:

  1. Add this line to your hosts file (Linux/macOS: /etc/hosts, Windows: C:\Windows\System32\Drivers\etc\hosts)

127.0.0.1 data.old_server.com

  1. Start fake server: python -m fake_server '{"result": "success"}'

Then all data send to data.old_server.com will now send to your own compute, and software will get normal response as before!

TODO

  • To real command line tool as fake-server;
  • Support https

Release files for fake-server 0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fake-server 0.1
File Size Uploaded
fake-server-0.1.tar.gz 3.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fake-server 0.1
File Interpreter ABI Platform
fake_server-0.1-py3-none-any.whl Python 3 none any Details

Total release size: 6.3 kB

Release files / fake-server-0.1.tar.gz

Download URL fake-server-0.1.tar.gz
Size 3.0 kB
Tags Source
SHA-256 checksum
How to use checksums
aa622cc691358c5419a44b6bb4df3688937e96e0c6915bd2a3b51c2f6afd22f2
BLAKE2b-256 checksum
How to use checksums
6b2f479fa5673339929c51d6a91de7b080838b840d454789c3a26bf88c48d6ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

Release files / fake_server-0.1-py3-none-any.whl

Download URL fake_server-0.1-py3-none-any.whl
Size 3.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5abb72c781091f7d9ec71ca6c5ea1c9f7c34d72c655b26c6d4f86995dfbc1478
BLAKE2b-256 checksum
How to use checksums
473783fe6232515281af27bad9d0f2d3fea60082391560725db3b10e2e7bab7b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

Release history Release notifications | RSS feed

This release

0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page