[英]HTTP parser/renderer library for Java/Scala
I'm searching for an asynchronous HTTP parsing/rendering library that can be hooked up to a stream of bytes (ie does not depend on direct socket access and does not create / expect actual network connections). 我正在寻找一个可以连接到字节流的异步HTTP解析/渲染库(即,不依赖于直接套接字访问,也不创建/期望实际的网络连接)。
Basically given a stream of bytes I want to be able to parse a HTTP request from it, potentially manipulate something and render it to a byte string. 基本上给定了字节流,我希望能够从中解析一个HTTP请求,潜在地操纵某些内容并将其呈现为字节字符串。 Both for requests and responses.
无论是请求还是响应。 Ideally for strict and chunked requests.
理想地用于严格和分块的请求。
In principal a manipulating Http proxy that works on input streams, java streams, reactive streams or something similar (client & server). 原则上讲,可在输入流,java流,响应流或类似内容(客户端和服务器)上使用的Http代理。
something like this: 像这样的东西:
stream of bytes <-> HttpLib <-> customCode <-> HttpLib <-> stream of bytes
so far I looked at 到目前为止,我看着
Any suggestions are welcome! 欢迎任何建议!
Update 更新资料
Regarding Akka HTTP: I mean the onUpstreamFailure behavior, which is handled directly in the serverLayer blueprint. 关于Akka HTTP:我的意思是onUpstreamFailure行为,该行为直接在serverLayer蓝图中处理。 I guess that's the most efficient / convenient default but how could streams stages after the serverLayer react to such errors (optionally) propagating the error would be more flexible.
我猜这是最有效/最方便的默认值,但是在serverLayer对此类错误做出反应(可选)之后,如何传播阶段会更灵活。
-> Bytes -> serverLayer -> customCode
|
<- (error response)
In case somebody stumbles across the question 万一有人偶然发现了这个问题
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.