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

No link returned from self-hosted server #1

Open
ricott1 opened this issue Sep 18, 2024 · 13 comments
Open

No link returned from self-hosted server #1

ricott1 opened this issue Sep 18, 2024 · 13 comments

Comments

@ricott1
Copy link

ricott1 commented Sep 18, 2024

Hi, I'm trying to self-host skicka but I cannot get it to work. When I run the example cat [my-file] | curl --data-binary @- [my-server] I do not get any link returned. Running the same example against you hosted service does return the link.

I tried to visit my server with a get request and it works. Any idea what could be wrong? Maybe some setting on my server machine?

@ricott1 ricott1 changed the title No link returning when self-hosting No link returned from self-hosted server Sep 18, 2024
@Patryk27
Copy link
Owner

Hi, are you using any sort of proxy (like nginx) before the request is routed to skicka?

@ricott1
Copy link
Author

ricott1 commented Sep 18, 2024

Yes, I am using caddy to reverse proxy to the listen port.

@Patryk27
Copy link
Owner

Alright, Caddy is most likely buffering the request/response instead of transmitting it "live" to Skicka - I've had similar issues when using Nginx as a reverse proxy.

Try setting request_buffers and response_buffers to zero; setting flush_interval to -1 might help as well.

@ricott1
Copy link
Author

ricott1 commented Sep 18, 2024

I'm running with the following directive

skicka.myserver.com {
        reverse_proxy localhost:32543 {
                flush_interval -1
                request_buffers 0
                response_buffers 0
        }
}

and various combinations of removing flush/buffers and still no link.

For completeness, I'm testing using cat test.file | curl --data-binary @- 'skicka.myserver.com'

@ricott1
Copy link
Author

ricott1 commented Sep 18, 2024

I tried removing the reverse proxy and it works like a charm. So indeed that's the problem

@Patryk27
Copy link
Owner

Yes, I haven’t been able to get Skicka working with Nginx either and finally just left it working on a separate port.

I’ll take a look later, considering Caddy also has issues with forwarding the requests, maybe it’s something in Skicka that triggers this behavior in proxies.

@Patryk27
Copy link
Owner

Alright, I've done some magic refactoring and managed to get Caddy's reverse_proxy working correctly 🎉 -- no extra options are needed, just reverse_proxy localhost:port.

Please check out and let me know back!

@ricott1
Copy link
Author

ricott1 commented Sep 19, 2024

Still not working for me :(. I pulled and rebuilt and tried with both

cat your-file.txt | curl -sT - skicka.myserver.com

and

cat test.file | curl --data-binary @- 'skicka.myserver.com'

in both cases the link is still not displayed, but if I change to myserver.com:[port] it does work (so it's still related to the reverse proxy probably).

My current directive is just reverse_proxy localhost:port as you suggest. If I remove the silent flag, on the server there is nothing displayed if I don't specify the port, while specifying the port does display the correct log (something like [0:encouraging-mailbox] connection created; active connections: 1).

Are you running exposing it on port 80 specifically? Because I'm exposing it under a subdomain, not sure if that matters?

@Patryk27
Copy link
Owner

Ouch 😢 I've been testing it locally under port 80, yeah - I'll try with subdomain as well and we'll see.

@Patryk27
Copy link
Owner

Alright, I've tested it on an actual server using Caddy and it seems to be working correctly, i.e. I've got:

http://skicka.acc.pwy.io:81 {
  reverse_proxy http://127.0.0.1:8080
}

... with Skicka running at 127.0.0.1:8080 - and I can run:

echo 'hi!' | curl -sT - skicka.acc.pwy.io:81

... which immediately shows me a working link; I'm testing it on Caddy 2.8.4.

@ricott1
Copy link
Author

ricott1 commented Oct 10, 2024

Sorry, I just saw your comment. What I'm trying to do is actually not expose the port (81 in your case) at all, but rather have something like

echo 'hi!' | curl -sT - skicka.acc.pwy.io

using

http://skicka.acc.pwy.io {
  reverse_proxy http://127.0.0.1:8080
}

This still does not work. It's not a big deal obviously, and thanks again for all the time you're spending on this, but I really don't understand what the problem could be. Sticking the port in front of it in the Caddy directive makes it work (like in your example).

@Patryk27
Copy link
Owner

My example uses :81, but that's just because on my server I'm already running nginx at :80 and I'd have to stop all my other services in other to play with Caddy there - but locally I've been testing as usual on :80 and there it works... weird.

What's your version of Caddy? I'm testing on 2.8.4.

@ricott1
Copy link
Author

ricott1 commented Oct 10, 2024

I'm also on 2.8.4. I'm over https, that's the only difference I can see tbh

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