Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proxy to translate chunked encoding to content-length #4

Open
2 tasks
pcppcp opened this issue Oct 20, 2018 · 1 comment
Open
2 tasks

Proxy to translate chunked encoding to content-length #4

pcppcp opened this issue Oct 20, 2018 · 1 comment

Comments

@pcppcp
Copy link

pcppcp commented Oct 20, 2018

As the Zephyr's http client doesn't support chunked encoding responses, we can't use parity as an ethereum node. But creating middleware that makes a request to Parity and fixes the headers shouldn't be difficult.

example of Parity request & response

POST / HTTP/1.1
Host: localhost:8545
User-Agent: curl/7.60.0
Accept: */*
Content-Type: application/json
Content-Length: 68

{"jsonrpc":"2.0","method":"web3_clientVersion","params":[],"id":987}


HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
Date: Sat, 20 Oct 2018 11:07:09 GMT

73
{"jsonrpc":"2.0","result":"Parity-Ethereum//v2.0.8-stable-ef8f95e-20181015/x86_64-linux-gnu/rustc1.29.0","id":987}

0
  • create a proxy that transparently encodes chunked encoding replies as content-length
  • create tests for the edge cases (reply with incorrect data length, content-length + chunked in a single reply ...)
@randomshinichi
Copy link
Collaborator

Will be useful when we want to use Infura instead of our own nodes (which is a real PITA with current ropsten fork problems)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants