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

How does one define paths for echo server ? Thanks #86

Closed
GuacheSuede opened this issue Mar 10, 2017 · 7 comments
Closed

How does one define paths for echo server ? Thanks #86

GuacheSuede opened this issue Mar 10, 2017 · 7 comments

Comments

@GuacheSuede
Copy link

No description provided.

@anirudhvr
Copy link
Contributor

What do you mean by 'paths'? Can you provide more detail on what you want to accomplish?

@GuacheSuede
Copy link
Author

for example /user or /post to a certain handler

@anirudhvr
Copy link
Contributor

anirudhvr commented Mar 11, 2017

Looks like you mean a HTTP handler. Wangle only provides the foundation for building servers/clients. Facebook's proxygen HTTP library, which builds on wangle and folly, is likely what you're looking for. There are some examples here - the echo server is the simplest: https://github.com/facebook/proxygen/tree/master/proxygen/httpserver/samples

@GuacheSuede
Copy link
Author

@anirudhvr Thank you for the reference , there are however no paths example

@anirudhvr
Copy link
Contributor

The echo example uses a very simple request handler that doesn't do much. You can take a look at RequestHandler internals and implemet your own that does different things based on paths. Here's an example of how to get a path from a request, though this specific example concentrates on HTTP2's push feature

https://github.com/facebook/proxygen/blob/master/proxygen/httpserver/samples/push/PushRequestHandler.cpp#L57

@GuacheSuede
Copy link
Author

great, so i just adapt if(headers->getPath() == "/requestLargePush") { to the echo handler ?

@anirudhvr
Copy link
Contributor

Yes, pretty much, you can do this in the EchoHandler as well. The proxygen project has a mailing list as well where the devs are active if you have more questions on this.

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