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

Connection refused on custom dflt_server on GET and POST #318

Open
afidegnum opened this issue Jan 29, 2024 · 4 comments
Open

Connection refused on custom dflt_server on GET and POST #318

afidegnum opened this issue Jan 29, 2024 · 4 comments
Labels
A-deployment Area: deployment C-bug Category: bug tribble-reported This issue was reported through Tribble.

Comments

@afidegnum
Copy link
Contributor

This issue is reporting a bug in the code of Perseus. Details of the scope will be available in issue labels.
The author described their issue as follows:

I am facing a connection refused error when I tried requesting from the same server after I implemented the custom server.
this is the request " reqwest::get("http://0.0.0.0:8080/.perseus/hello")"
I tried the following urls as well with no success: "http://0.0.0.0:8080/hello"
:/hello"

The steps to reproduce this issue are as follows:

You can clone and test directly from your end.
Another question.
What are best practices when submitting a form? I also faced similar issue when I tried posting a form at the engine configuration side.

A minimum reproducible example is available at https://github.com/afidegnum/custom_test_server.

  • Hydration-related: false
  • The author is willing to attempt a fix: false
Tribble internal data

dHJpYmJsZS1yZXBvcnRlZCxDLWJ1ZyxBLWRlcGxveW1lbnQ=

@github-actions github-actions bot added A-deployment Area: deployment C-bug Category: bug tribble-reported This issue was reported through Tribble. labels Jan 29, 2024
@arctic-hen7
Copy link
Member

Have you tried requesting from localhost rather than 0.0.0.0? Also, if you're running in a Docker container that can cause these kinds of issues.

@afidegnum afidegnum changed the title Connection refused on custom dflt_server Connection refused on custom dflt_server on GET and POST Jan 30, 2024
@afidegnum
Copy link
Contributor Author

I tried 0.0.0.0 then 127.0.0.1 and this test is done on the bare machine not on docker. I had that error on docker which prompted me to run the test locally

@afidegnum
Copy link
Contributor Author

afidegnum commented Jan 30, 2024

A quick question. while implementing on Server integrations, how do I pass in web::Data including custom middleware from actix to perseus, I'm trying to port in a sample authentication feature as well but I'm not able to implement directly actix's HttpRequest and HttpResponse on perseus, I noticed perseus is heavilly based on http and hyper, is there any implementation doorway?

UPDATE:
this is my new implementation: https://github.com/afidegnum/custom_test_server/tree/actize

I'm not able to pass cookies and sessions from pub async fn dflt_server
to various states generations, can you please guide?

@arctic-hen7
Copy link
Member

Sorry for the late reply! You should be able to access all the details of the request in the request state generation function, though anything you would put in web::Data should go in your global state instead under #[cfg(engine)]. If it can't be serialized, try putting it in a lazy_static! or similar instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-deployment Area: deployment C-bug Category: bug tribble-reported This issue was reported through Tribble.
Projects
None yet
Development

No branches or pull requests

2 participants