Error running on remote host
See original GitHub issueTo reproduce: setup mailslurper on a vagrant. In my example below, I am using Ubuntu 14.04 and the vagrant will have the IP 192.168.33.10.
On the vagrant download and extract mailslurper 1.11. Modify config to look like the following:
{
"wwwAddress": "192.168.33.10",
"wwwPort": 8080,
"serviceAddress": "192.168.33.10",
"servicePort": 8085,
"smtpAddress": "192.168.33.10",
"smtpPort": 2500,
"dbEngine": "SQLite",
"dbHost": "",
"dbPort": 0,
"dbDatabase": "./mailslurper.db",
"dbUserName": "",
"dbPassword": "",
"maxWorkers": 1000,
"autoStartBrowser": false,
"keyFile": "",
"certFile": ""
}
Now open up a browser and go to http://192.168.33.10:8080 Mailslurper should appear and you should be greeted with the alert: “There was an error getting mail items”. If you check the network requests, you’ll notice that there is a request for: “http://0.0.0.0:8085/mail?pageNumber=1&message=&start=2016-03-01&end=2016-03-31&orderby=date&dir=desc&_=1459175709827”. Which should not be pointing at 0.0.0.0.
I think this is some sort of timing issue, because a request to http://192.168.33.10:8080/servicesettings returns the expected json:
{
"serviceAddress": "192.168.33.10",
"servicePort": 8085,
"version": "v1"
}
Issue Analytics
- State:
- Created 7 years ago
- Comments:11 (4 by maintainers)
Top GitHub Comments
Hi, we are still experiencing this issue. This bug effectively limits the use of the web interface to a local machine. The web browser trying to make an ajax connection with http://0.0.0.0:(port) is just plain weird. The easiest solution I can imagine would just be to add another configuration that allows the administrator to set the outside host name/uri. Would be useful in cases where a load balancer is in the way as well.
I reproduce the problem. I use Vagrant with a VM only configured with NAT network, so my VM is not directly accessible, i use port forwarding to access mailslurper webapp. My configuration:
Port redirection on my VM : TCP 4300->4300 TCP 4301->4301 TCP 2500->2500
Server start log:
Now open up a browser and go to http://my-host-ip:4300, it makes a request to http://my-host-ip:4301/servicesettings returning wrong json:
{ “serviceAddress”: “0.0.0.0”, “servicePort”: 4301, “version”: “v1” }
So next, all request to service endpoint tries to communicate with http://0.0.0.0:4301, which is not reachable from my host
If I modify serviceSettings key that is cached in the browser localStorage like this:
then all works fine