New formats and examples - #197
Merged
Merged
Conversation
added 7 commits
January 10, 2026 16:20
New format definitions (20260110.json): - 20+ regex formats including: lowercase, uppercase, words, hex, binary, base64, alphanumeric, csv, ip-address, domain, email, url-path, key-value, timestamp, http-simple, and sentences - Each format includes both request and response variants - All formats tested and verified New format tests (test_formats.py): - 43 comprehensive tests for all formats - Tests for encoding, decoding, and roundtrip verification - Tests for edge cases and various input sizes - Tests for legacy format compatibility New examples: - basic/: Getting started scripts and documentation - formats/: Demonstrations of different output formats - comparison_demo.py: Side-by-side format comparison - words_demo.py: Space-separated word output - http_demo.py: HTTP-like output format - programmatic/: Python API usage examples - simple_encoder.py: Direct FTE encoding without sockets - echo_server.py/echo_client.py: FTE-wrapped sockets - format_demo.py: All formats demonstration - custom_format.py: Creating custom regex formats - file_transfer.py: File transfer over FTE - integration/: Integration with other tools - ssh_tunnel.sh: SSH over FTE - web_proxy.sh: Web proxy over FTE - secure_chat.py: Encrypted chat application All 62 tests pass.
New protocol formats in 20260110.json: - ssh-request/response: SSH-2.0 protocol banner (e.g., SSH-2.0-OpenSSH_8.4) - tls-sni-request/response: TLS Server Name Indication style (subdomain.domain.tld) - smtp-request/response: SMTP EHLO command and 250 response - ftp-request/response: FTP USER command and welcome banner Added corresponding tests in test_formats.py: - Individual tests for each protocol format - Parameterized tests for protocol request formats - All 50 format tests pass
- System tests: 120s -> 300s (5 minutes) - Relay tests: 60s -> 180s (3 minutes) - Remove GMP installation steps (no longer needed with fte 0.2.1)
- Add fteproxy/__main__.py to enable 'python -m fteproxy' invocation - Update all shell scripts to use 'python -m fteproxy' instead of './bin/fteproxy' - This is more canonical as it works regardless of installation method Users can now run fteproxy via: - python -m fteproxy (works after pip install or from source) - fteproxy (works after pip install, via entry_points)
Replace netcat_simple.sh and netcat_verbose.sh with a single demo.sh that: - Has proper cleanup (trap to kill background processes on exit) - Waits for servers to start before netcat binds - Uses nc (more portable than netcat) - Shows clear ASCII diagram of traffic flow - Provides copy-pasteable command for testing - Has informative startup messages Added README.md with documentation and traffic flow diagram.
- Complete rewrite of examples/README.md with: - ASCII art showing what fteproxy does - Directory structure with emoji icons - Detailed section for each example category - Code snippets and usage instructions - Traffic flow diagrams - Available formats table - Use cases section - Updated chat/README to README.md with: - Traffic flow diagram - Code snippets showing wrap_socket usage - Format table - Customization examples
- Replace box-drawing characters with ASCII art (+, -, |, =) - Replace emoji checkmarks with [OK], [ERROR], [FAIL] - Remove emoji icons from headers and directory listings - Use plain ASCII throughout for maximum compatibility
kpdyer
force-pushed
the
new-formats-and-examples
branch
from
January 11, 2026 00:20
3dfae80 to
6b67e77
Compare
added 6 commits
January 10, 2026 16:22
The bin/fteproxy script is no longer needed because: - fteproxy/__main__.py enables 'python -m fteproxy' - entry_points in setup.py/pyproject.toml creates 'fteproxy' command after pip install - The py2exe 'frozen' code path was obsolete
The wrapper now delegates setsockopt and getsockopt to the underlying
socket, allowing code like:
s = fteproxy.wrap_socket(s, ...)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
Also fixed chat/server.py example to call setsockopt before wrap_socket
(works either way now).
- Server and client now have a scripted 10-round conversation - Each side sends predefined messages about FTE - Updated README with sample output and wire format examples - Shows how traffic looks different on the wire vs what apps see
Migrated versioning to the more Pythonic approach:
- Added __version__ = '0.2.19' to fteproxy/__init__.py
- Updated cli.py to import version from fteproxy.__version__
- Updated setup.py to parse version from __init__.py
- Updated pyproject.toml to use {attr = 'fteproxy.__version__'}
- Updated MANIFEST.in to remove VERSION
- Updated GitHub Actions to use fteproxy.__version__
- Deleted fteproxy/VERSION file
…proxy The get_fteproxy_cmd() function was trying to use bin/fteproxy which was deleted. Updated to use the canonical 'python -m fteproxy' approach.
- Created fteproxy/tests/test_examples.py to test all examples - Updated all example scripts to use sys.exit() with proper return codes - Added [OK]/[FAIL] indicators to all examples for verification - Added 'example-tests' job to GitHub Actions workflow - Self-contained examples (formats, simple_encoder, etc.) tested directly - Client/server examples (chat, echo) tested by spawning both processes - file_transfer.py now has a self-test mode when run without arguments All 9 example tests pass locally.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds comprehensive format definitions and examples to fteproxy.
New format definitions (20260110.json):
base64, csv, ip-address, domain, email, url-path, sentences, and more
New examples:
Other improvements: