Commit 4b00009
committed
47.5 RC. Issue #165. Option for Mongoose web server to listen on all IP addresses available.
In settings.json set: "listen_on": ["*", 54007] - this will make web server to listen on 127.0.0.1
and on 192.168.0.x and also on a public internet ip address. During testing I only confirmed
that it listened on local ip addresses (127.xxx and 192.xxx), I couldn't make it work for the internet
ip address - not sure if this is an issue in Mongoose web server, or or my router's port forwarding
wasn't configured properly. Note also that when listen_on is set to "*" then the SERVER_NAME
environment variable will still be set to 127.0.0.1 - this may cause issues in PHP scripts that
depend on that env variable. To fix it add this code at the top of all your PHP scripts:
<?php $_SERVER["SERVER_NAME"] = $_SERVER["HTTP_HOST"]; ?>
This will set SERVER_NAME to an ip address that the web server is being accessed from.
For example when accessing from 127.0.0.1 it will be set to that. When accessing from 192.168.0.2
then it will be 192.xxx in that case.1 parent fa2ef7b commit 4b00009
2 files changed
+25
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
51 | | - | |
| 50 | + | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
150 | | - | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
151 | 157 | | |
152 | 158 | | |
153 | 159 | | |
| |||
158 | 164 | | |
159 | 165 | | |
160 | 166 | | |
161 | | - | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
162 | 173 | | |
163 | 174 | | |
164 | 175 | | |
| |||
184 | 195 | | |
185 | 196 | | |
186 | 197 | | |
187 | | - | |
188 | | - | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
189 | 205 | | |
190 | 206 | | |
191 | 207 | | |
| |||
0 commit comments