Access ddev web container from other hosts
up vote
0
down vote
favorite
I want to access the ddev web container from another host. How can I achieve this?
For example: ddev is running on host A, I want to access the web page from host B.
ddev
add a comment |
up vote
0
down vote
favorite
I want to access the ddev web container from another host. How can I achieve this?
For example: ddev is running on host A, I want to access the web page from host B.
ddev
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I want to access the ddev web container from another host. How can I achieve this?
For example: ddev is running on host A, I want to access the web page from host B.
ddev
I want to access the ddev web container from another host. How can I achieve this?
For example: ddev is running on host A, I want to access the web page from host B.
ddev
ddev
asked 19 hours ago
Chris
576
576
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
There is a good summary of techniques on https://medium.com/botfuel/how-to-expose-a-local-development-server-to-the-internet-c31532d741cc and I see a number of others - It suggests:
- ngrok (See existing ddev issue)
- localtunnel
- Just proxying with an ssh tunnel.
So there are at least two variants of what you're talking about:
- Just proxying to an exposed port on your host machine for access by another machine on your local network.
- Proxying your local development environment to a host on the internet for access from anywhere.
For either approach, we need to figure out what port to proxy.
If you can just use http, I'd proxy the localhost port (which goes directly to the web container and doesn't care what the hostname in the URL is). So if ddev describe
shows http://d7git.ddev.local:8080, https://d7git.ddev.local:8443, http://127.0.0.1:32827
, use the 127.0.0.1 port (32827 in this case). If you can do this, you won't have to fiddle with faking the hostname on the host from which you're going to access this.
So for option 1 (just exposing on another port on your machine), use any of these technqiues. I'll use the socat approach on macOS (brew install socat).
socat tcp-listen:8889,reuseaddr,fork tcp:localhost:32827
where 32827 is the port listed by ddev describe as localhost access, and 8889 is the port you want to expose to others. Then find out your local network IP address (Use ifconfig or other techniques) and others can access your ddev project with that. For example, my setup today would be http://10.150.150.87:32827/
For option 2, Proxying your project for somebody else to use on the internet, via ssh tunneling:
ssh -R :9101:localhost:32827 user@host.example.com
That will tunnel your local port 32827 (check your own ddev describe for this) to port 9101 on the remote host.example.com. Note that you'll likely have to
- Change the firewall config to enable access to that port on the remote host
- Enable
GatewayPorts yes
in the host's sshd config.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
There is a good summary of techniques on https://medium.com/botfuel/how-to-expose-a-local-development-server-to-the-internet-c31532d741cc and I see a number of others - It suggests:
- ngrok (See existing ddev issue)
- localtunnel
- Just proxying with an ssh tunnel.
So there are at least two variants of what you're talking about:
- Just proxying to an exposed port on your host machine for access by another machine on your local network.
- Proxying your local development environment to a host on the internet for access from anywhere.
For either approach, we need to figure out what port to proxy.
If you can just use http, I'd proxy the localhost port (which goes directly to the web container and doesn't care what the hostname in the URL is). So if ddev describe
shows http://d7git.ddev.local:8080, https://d7git.ddev.local:8443, http://127.0.0.1:32827
, use the 127.0.0.1 port (32827 in this case). If you can do this, you won't have to fiddle with faking the hostname on the host from which you're going to access this.
So for option 1 (just exposing on another port on your machine), use any of these technqiues. I'll use the socat approach on macOS (brew install socat).
socat tcp-listen:8889,reuseaddr,fork tcp:localhost:32827
where 32827 is the port listed by ddev describe as localhost access, and 8889 is the port you want to expose to others. Then find out your local network IP address (Use ifconfig or other techniques) and others can access your ddev project with that. For example, my setup today would be http://10.150.150.87:32827/
For option 2, Proxying your project for somebody else to use on the internet, via ssh tunneling:
ssh -R :9101:localhost:32827 user@host.example.com
That will tunnel your local port 32827 (check your own ddev describe for this) to port 9101 on the remote host.example.com. Note that you'll likely have to
- Change the firewall config to enable access to that port on the remote host
- Enable
GatewayPorts yes
in the host's sshd config.
add a comment |
up vote
0
down vote
There is a good summary of techniques on https://medium.com/botfuel/how-to-expose-a-local-development-server-to-the-internet-c31532d741cc and I see a number of others - It suggests:
- ngrok (See existing ddev issue)
- localtunnel
- Just proxying with an ssh tunnel.
So there are at least two variants of what you're talking about:
- Just proxying to an exposed port on your host machine for access by another machine on your local network.
- Proxying your local development environment to a host on the internet for access from anywhere.
For either approach, we need to figure out what port to proxy.
If you can just use http, I'd proxy the localhost port (which goes directly to the web container and doesn't care what the hostname in the URL is). So if ddev describe
shows http://d7git.ddev.local:8080, https://d7git.ddev.local:8443, http://127.0.0.1:32827
, use the 127.0.0.1 port (32827 in this case). If you can do this, you won't have to fiddle with faking the hostname on the host from which you're going to access this.
So for option 1 (just exposing on another port on your machine), use any of these technqiues. I'll use the socat approach on macOS (brew install socat).
socat tcp-listen:8889,reuseaddr,fork tcp:localhost:32827
where 32827 is the port listed by ddev describe as localhost access, and 8889 is the port you want to expose to others. Then find out your local network IP address (Use ifconfig or other techniques) and others can access your ddev project with that. For example, my setup today would be http://10.150.150.87:32827/
For option 2, Proxying your project for somebody else to use on the internet, via ssh tunneling:
ssh -R :9101:localhost:32827 user@host.example.com
That will tunnel your local port 32827 (check your own ddev describe for this) to port 9101 on the remote host.example.com. Note that you'll likely have to
- Change the firewall config to enable access to that port on the remote host
- Enable
GatewayPorts yes
in the host's sshd config.
add a comment |
up vote
0
down vote
up vote
0
down vote
There is a good summary of techniques on https://medium.com/botfuel/how-to-expose-a-local-development-server-to-the-internet-c31532d741cc and I see a number of others - It suggests:
- ngrok (See existing ddev issue)
- localtunnel
- Just proxying with an ssh tunnel.
So there are at least two variants of what you're talking about:
- Just proxying to an exposed port on your host machine for access by another machine on your local network.
- Proxying your local development environment to a host on the internet for access from anywhere.
For either approach, we need to figure out what port to proxy.
If you can just use http, I'd proxy the localhost port (which goes directly to the web container and doesn't care what the hostname in the URL is). So if ddev describe
shows http://d7git.ddev.local:8080, https://d7git.ddev.local:8443, http://127.0.0.1:32827
, use the 127.0.0.1 port (32827 in this case). If you can do this, you won't have to fiddle with faking the hostname on the host from which you're going to access this.
So for option 1 (just exposing on another port on your machine), use any of these technqiues. I'll use the socat approach on macOS (brew install socat).
socat tcp-listen:8889,reuseaddr,fork tcp:localhost:32827
where 32827 is the port listed by ddev describe as localhost access, and 8889 is the port you want to expose to others. Then find out your local network IP address (Use ifconfig or other techniques) and others can access your ddev project with that. For example, my setup today would be http://10.150.150.87:32827/
For option 2, Proxying your project for somebody else to use on the internet, via ssh tunneling:
ssh -R :9101:localhost:32827 user@host.example.com
That will tunnel your local port 32827 (check your own ddev describe for this) to port 9101 on the remote host.example.com. Note that you'll likely have to
- Change the firewall config to enable access to that port on the remote host
- Enable
GatewayPorts yes
in the host's sshd config.
There is a good summary of techniques on https://medium.com/botfuel/how-to-expose-a-local-development-server-to-the-internet-c31532d741cc and I see a number of others - It suggests:
- ngrok (See existing ddev issue)
- localtunnel
- Just proxying with an ssh tunnel.
So there are at least two variants of what you're talking about:
- Just proxying to an exposed port on your host machine for access by another machine on your local network.
- Proxying your local development environment to a host on the internet for access from anywhere.
For either approach, we need to figure out what port to proxy.
If you can just use http, I'd proxy the localhost port (which goes directly to the web container and doesn't care what the hostname in the URL is). So if ddev describe
shows http://d7git.ddev.local:8080, https://d7git.ddev.local:8443, http://127.0.0.1:32827
, use the 127.0.0.1 port (32827 in this case). If you can do this, you won't have to fiddle with faking the hostname on the host from which you're going to access this.
So for option 1 (just exposing on another port on your machine), use any of these technqiues. I'll use the socat approach on macOS (brew install socat).
socat tcp-listen:8889,reuseaddr,fork tcp:localhost:32827
where 32827 is the port listed by ddev describe as localhost access, and 8889 is the port you want to expose to others. Then find out your local network IP address (Use ifconfig or other techniques) and others can access your ddev project with that. For example, my setup today would be http://10.150.150.87:32827/
For option 2, Proxying your project for somebody else to use on the internet, via ssh tunneling:
ssh -R :9101:localhost:32827 user@host.example.com
That will tunnel your local port 32827 (check your own ddev describe for this) to port 9101 on the remote host.example.com. Note that you'll likely have to
- Change the firewall config to enable access to that port on the remote host
- Enable
GatewayPorts yes
in the host's sshd config.
edited 9 hours ago
answered 9 hours ago
rfay
1,106714
1,106714
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53371087%2faccess-ddev-web-container-from-other-hosts%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown