用于运行描述每个帧的http/2代理的python库和cli

tcp-h2-describe的Python项目详细描述


tcp-h2-describe

Python library and CLI for running an HTTP/2 proxy that describes each frame

安装

python3 -m pip install --upgrade tcp-h2-describe

用法

例如,在运行本地HTTP/2服务器的计算机上 端口50051:

$ tcp-h2-describe --server-port 50051
Starting tcp-h2-describe proxy server on port 24909
  Proxying server located at localhost:50051
...
$ # OR
$ python -m tcp_h2_describe --server-port 50051
Starting tcp-h2-describe proxy server on port 24909
  Proxying server located at localhost:50051
...

选项还存在自定义^ ^ {CD1>}代理的端口 运行以及代理的远程服务器:

$ python -m tcp_h2_describe --help
usage: tcp-h2-describe [-h] [--proxy-port PROXY_PORT]
                       [--server-host SERVER_HOST] [--server-port SERVER_PORT]

Run `tcp-h2-describe` reverse proxy server. This will forward traffic to a
proxy port along to an already running HTTP/2 server. For each HTTP/2 frame
forwarded (either client->server or server->client) a description will be
printed to the console explaining what each byte in the frame means.

optional arguments:
  -h, --help            show this help message and exit
  --proxy-port PROXY_PORT
                        The port that will be used for running the "describe"
                        proxy. (default: 24909)
  --server-host SERVER_HOST
                        The hostname for the server that is being proxied.
                        (default: None)
  --server-port SERVER_PORT
                        The port for the server that is being proxied.
                        (default: 80)

直接从python代码中使用

importtcp_h2_describeproxy_port=13370server_port=50051tcp_h2_describe.serve_proxy(proxy_port,server_port)# OR: Spawn a thread to avoid blockingimportthreadingserver_thread=threading.Thread(target=tcp_h2_describe.serve_proxy,args=(proxy_port,server_port),)server_thread.start()

代理HTTP servergRPC server时请参见示例输出。 另外,tcp-h2-describe代理支持proxy protocol

开发

要添加功能或运行测试,请参见DEVELOPMENT doc 有关如何开始的详细信息。

许可证

tcp-h2-describe在apache 2.0许可下可用。更多 详细信息,请参见LICENSE

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java Android测试运行失败:没有测试结果   java设置JMenuItems与Nimbus LaF的边界   java是使用springboot、Crudepository和MySQL检查重复值的好方法吗   谷歌电子表格的Java时代日期   java向xml文件添加EditText不起作用   java ORA00933:SQL命令未正确结束WHERE子句   如何在java中防止JTextField上使用CTRL+C?   java绑定到TypeLiteral在google guice中是好的还是坏的做法   java找到了原始类型,缺少泛型类的返回参数   Kafka Streams API中ArrayList Serde的java问题   java在hibernate中,哪种持久化上下文的性能更好?   java通过本机查询获取数据库url、名称和模式版本   如何为Java枚举编写通用for循环?   在Java应用程序中播放MP3   如何使用VisualVM度量短时间运行的Java应用程序的性能?   java从当前日期获取datetime(秒)   简单JMH基准中的javagrpcoome和NPE   java如何加载Maven项目库中Spring jar的应用程序上下文   JavaCC XPath解析器   用于Scala和Java的类型安全生成器库