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

Redirect incoming and outgoing traffic in router #2

Open
amrit073 opened this issue Nov 5, 2022 · 3 comments
Open

Redirect incoming and outgoing traffic in router #2

amrit073 opened this issue Nov 5, 2022 · 3 comments

Comments

@amrit073
Copy link

amrit073 commented Nov 5, 2022

I am trying to run server in my router and use custom domain using cloudflared.
I have compiled cloudflared for router's architecture (mips) and installed it.
But shell in not allowing cloudflared to make https request to its servers.

@anitsh anitsh transferred this issue from anitsh/til Nov 5, 2022
@anitsh anitsh changed the title can't curl/wget into https sites, maybe we can install ca-certs manually. But how> Redirect incoming and outgoing traffic in router Nov 5, 2022
Repository owner deleted a comment from amrit073 Nov 5, 2022
@anitsh
Copy link
Owner

anitsh commented Nov 5, 2022

Hi @amrit073,

Were you really able to install server on your router?

I think what you might have done is run a server in your local machine, laptop.

You have to have static IP or public IP to share your system/API in public.

Then in your router you have to open and map the port. Open port to allow requests from outside is allowed. Then map the same port to your local machine's and it IP.

For example, you have opened port 80 in your router. And your are running an application in port 8080. Then you map routers 80 port to machine running application with IP 192.168.1.100 port 8080.

In other words, redirect incoming and outgoing traffic to and from 80 > 192.168.1.100:8080.

On ca-certs, https://letsencrypt.org would be best.
For reference, anitsh/til#60 - My attempt and learning from hosting website from home setup.

Also, please delete the first empty comment. [I've done that on your behalf]
Make title more short and specific. [I've done that on your behalf]
Add more details on your question.

Helps everyone to understand and be of more help to you.

Cheers,

@amrit073
Copy link
Author

amrit073 commented Nov 5, 2022

@anitsh
I am used nc to listen to a port and served html page to incoming request.
My server.sh file:
while true; do echo -e "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n" | cat - index.html | nc -l -p 8000; done
I was able to access website in via my other devices from :8000. I tried cloudflared to add my custom domain but that will need router shell to make https requests.

@anitsh
Copy link
Owner

anitsh commented Nov 24, 2022

@amrit073 The default port is 80 for HTTP request. May be you can try with -p 80. But still serving HTTP requests via nc might not be very useful if we are looking forward to build a useful system.

@github-staff github-staff deleted a comment from robincj Apr 27, 2024
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