Download MetaTrader 5
To add comments, please log in or register
Find out how to install MetaTrader on Linux
xuzhe
100
xuzhe 2014.12.17 06:54 

i test the WebRequest() function on some public domains,such as www.google.com www.mql5.com works very well.

 

but when i use it on LocalHost domians,it doesn't work anymore.

 

i did add localhost domain in the EA tab of option menn. 

SYED NAUFAL GADDAFI
1401
SYED NAUFAL GADDAFI 2014.12.17 07:37  
Try 127.0.0.1
xuzhe
100
xuzhe 2014.12.21 13:31  
deysmacro:
Try 127.0.0.1

doesn't work,any other solutions?

 

thanks for your reply 

whroeder1
13610
whroeder1 2014.12.21 17:39  
deysmacro: Try 127.0.0.1
or edit \windows\system32\drivers\etc\hosts and add localhost
xuzhe: doesn't work,any other solutions?
Do you have a web server running on localhost? If you enter localhost into your browser do you get a page?
SYED NAUFAL GADDAFI
1401
SYED NAUFAL GADDAFI 2014.12.22 00:50  
WHRoeder:
xuzhe: doesn't work,any other solutions?
Do you have a web server running on localhost? If you enter localhost into your browser do you get a page?
If there is no page at all, that would be completely different story.
whroeder1
13610
whroeder1 2014.12.22 02:38  
xuzhe: it doesn't work anymore.
"Doesn't work" is meaningless - just like saying the car doesn't work. Doesn't start, won't go in gear, no electrical, missing the key, flat tires - meaningless. There are no mind readers here.
deysmacro: that would be completely different story.
No information given, only guesses ventured. How is "no page at all" different from "doesn't work"?
JC
1394
JC 2014.12.22 08:10  
xuzhe:

but when i use it on LocalHost domians,it doesn't work anymore.

I can't see a problem using localhost. The following works fine for me:

   char arrPost[], arrResult[];
   string strResponseHeaders;
   int res = WebRequest("GET", "http://localhost/test.htm", NULL, NULL, 10000, arrPost, 0, arrResult, strResponseHeaders);
   Print("Result: ", res, ", error: " , GetLastError());
   Print(CharArrayToString(arrResult));
xuzhe
100
xuzhe 2014.12.24 03:54  
WHRoeder:
deysmacro: Try 127.0.0.1
or edit \windows\system32\drivers\etc\hosts and add localhost
xuzhe: doesn't work,any other solutions?
Do you have a web server running on localhost? If you enter localhost into your browser do you get a page?

Of course i have a web server running,and the browser can get the page on localhost fine.

 

i got the page,but metatrader runtime failed.

 

should i use port 80? 

xuzhe
100
xuzhe 2014.12.25 03:17  

I know the answer now.

 

Only Port 80 and 433 is allowed.

 

i think the document should mentioned this.

/
To add comments, please log in or register