Comments (18)
really sorry for the lack of reply. yes i still plan a PR - realistically
next month. i was, and still am, crunching this month with the upcoming
release of our cloud service (uses proxygen). once crunching is over, i can
ship a PR.
On 22 March 2016 at 20:45, afrind [email protected] wrote:
@jamperry https://github.com/jamperry are you still planning a PR?
β
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#77 (comment)
from proxygen.
@jamperry any update about the PR?
from proxygen.
Hi @jamperry, thanks for your interest to contribute, we definitely welcome your contribution. Would you be able to submit a PR with some documentation (may be in the form of comments in the code)?
from proxygen.
No problem, I will add comments to make it more clearer. I will submit a PR over the weekend.
from proxygen.
I have to that by doing this!
restRoutes.routeAdd("/indexation/test", "testIndexation",{"POST"});
restRoutes.routeAdd("/status", "getStatus",{"GET","POST"});
void Routes::routeAdd(std::string path, std::string action, acceptedMethods
methods) {
boost::mutex::scoped_lock scope_lock(Route);
this->methods[path] = methods;
this->actions[path] = action;
}
bool Routes::routeExist(std::string path) ;
std::string Routes::getAction(std::string path);
bool Routes::routeMethodValid(std::string path, std::string method);
sRequest Server::request(restHeader header) {
sRequest responseBuild;
responseBuild.status = 200;
bool routeExist = restRoutes.routeExist(header["path"]);
bool methodAccepted = restRoutes.routeMethodValid(header["path"],
header["method"]);
if (routeExist && methodAccepted) {
this->action = restRoutes.getAction(header["path"]);
logger.info("Executin action: %s => method: %s route: %s",
action.c_str(), header["method"].c_str(), header["path"].c_str());
} else if (!routeExist) {
responseBuild.message = "Route not found";
responseBuild.status = 404;
logger.error("Route not found => method: %s route: %s",
header["method"].c_str(), header["path"].c_str());
} else if (!methodAccepted) {
responseBuild.message = "Method not Applied";
responseBuild.status = 405;
logger.error("Method is not accepted for this route => method %s
route: %s", header["method"].c_str(), header["path"].c_str());
}
if (responseBuild.status != 200) {
responseBuild.body = "";
}
return responseBuild;
}
Douglas M Cordeiro [email protected].
2016-01-10 16:43 GMT-02:00 James Perry [email protected]:
I have written a HTTP router by extending RequestHandlerFactory to
multiplex paths to RequestHandler implementations. The routing uses a
compacted prefix tree.Is this something you are interested in having in your repo or should I
create a separate repo for it? If you are interested then I will merge it
with tests into a public fork and then submit a PR.β
Reply to this email directly or view it on GitHub
#77.
from proxygen.
Curious what the status of this is. Any updates?
from proxygen.
Any news?
from proxygen.
@jamperry are you still planning a PR?
from proxygen.
Sharing a constexpr
based PrefixRouter along with a sample application at https://github.com/bajaarbot/proxygen_template.
Maybe OP is referring to marisa-trie if someone wants to try that instead.
from proxygen.
Hi guys,
FYI: I implemented a small router based on libr3: https://github.com/rmedaer/proxygen-routing
@jhonatandarosa @jamperry not sure to understand why it should be embedded in Proxygen library itself...
@bajaarbot mine is using r3.
from proxygen.
Nice work. Just be warned that tries can take a hit on cache-misses.
Check this recent discussion
(https://news.ycombinator.com/item?id=12914495), specifically the
comment on LCPs. Another option is to generate a hash : (prefix) =>
[array of matching routes]
On 11/09/2016 11:40 PM, RaphaΓ«l Medaer wrote:
Hi guys,
FYI: I implemented a small router based on libr3:
https://github.com/rmedaer/proxygen-routing@jhonatandarosa https://github.com/jhonatandarosa @jamperry
https://github.com/jamperry not sure to understand why it should be
embedded in Proxygen library itself...
@bajaarbot https://github.com/bajaarbot mine is using r3.β
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#77 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AMKpmp-kGhk9Mv04XeaYqeBtCgErLv4kks5q8gx_gaJpZM4HB7lZ.
from proxygen.
It seems like folks are building this on their own in a variety of different ways. If someone really likes their implementation and would like to incorporate it into the library, submit a PR and we will review it. In the meantime, we recommend that if you need this functionality you grab it from one of the linked projects.
from proxygen.
@jamperry Hey James,could you post your routing example here ? Thank You, Justin
from proxygen.
Hey @afrind, is this still needed? I would like to contribute to the project and this seems like a good start.
from proxygen.
@VitorFalcao yes, help still needed
from proxygen.
Any news or example with routing ?
Thanks!
from proxygen.
I think there's a reasonable example in the early comments. Not much news. We are planning to open source more HTTP components in the coming months, but I'm not sure this is prioritized. We'd still welcome a PR for a generic router/dispatcher component for the HTTP-server.
from proxygen.
I'm going to close this issue - but if someone has a component to share feel free to put up a PR and reopen/link it here.
from proxygen.
Related Issues (20)
- This resolves CVE-2023-44487.
- Building Proxygen in Windows
- HTTP3 Server and Client from samples HOT 11
- Does proxygen support iOS ?
- Transferring Sessions between threads for Http Client Connection Pool HOT 8
- DetachThreadLocals() fails CHECK HOT 22
- Homebrew build of proxygen failing HOT 7
- ServerIdleSessionConroller:getIdleSession() returns session already in thread HOT 5
- Concurrent performance supported by the HTTP server
- Websocket Key Mismatch HOT 2
- Connection Close Reason SHUTDOWN HOT 3
- `EchoHandler` in `proxygen/httpserver/samples/echo/EchoHandler.h` has unnecessary `body_` member
- Request smuggling vulnerability in Proxygen
- websocket client with SSL problem: Server replied to me "Bad Request" HOT 5
- proxygen fails to build when a newer glog package is installed
- Proxygen for iOS HOT 2
- httpserver/samples/websocket
- Ingress Error and drain() HOT 2
- httpserver/samples/websocket
- Segfault in HQ server
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from proxygen.