The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How can I allow the server to get HTTP request from others?

Discussion in 'General Discussion' started by k26646977, Apr 5, 2016.

  1. k26646977

    k26646977 Registered

    Joined:
    Apr 5, 2016
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    HONG KONG
    cPanel Access Level:
    Website Owner
    In my project, I need thingHTTP to send a HTTP get request to my website and then my website give response.

    However, the server fail to give response and I am wondering whether it is a problem of cross-domain. So I add header('Access-Control-Allow-Origin: *'); but it does not work.

    I ask thingspeak and they say my website is expecting the request to come from a browser. What can I do?

    Here is my website: - Removed -
    thanks!
     
    #1 k26646977, Apr 5, 2016
    Last edited by a moderator: Apr 5, 2016
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    653
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Could you provide some more details on the data you are fetching with your application? Is your application hosted on a local workstation, a remote server, or is it installed on the same server as your cPanel account? Are you seeking to have the application fetch the entire contents of a web page? Is "cURL" an option?

    Thank you.
     
  3. k26646977

    k26646977 Registered

    Joined:
    Apr 5, 2016
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    HONG KONG
    cPanel Access Level:
    Website Owner
    Sorry, we change to use ESP8266 and Arduino to get the web content. And the server reply this:

    Code:
    HTTP/1.1 200 OK
    Cache-Control: no-cache
    Connection: keep-alive
    Date: Wed, 06 Apr 2016 10:10:24 GMT
    Via: 1.1 202.140.78.212:3128 (squid/2.7.STABLE6)
    Server: nginx
    Vary: Accept-Encoding
    Content-Length: 910
    Content-Type: text/html
    Expires: Thu, 01 Jan 1970 00:00:01 GMT
    Client-Peer: 10.6.35.16:80
    Client-Response-Num: 1
    X-Cache: MISS from 202.140.78.212
    X-Cache-Lookup: MISS from 202.140.78.212:3128
    
    <html><body><script type="text/javascript" src="/aes.js" ></script><script>function toNumbers(d){var e=[];d.replace(/(..)/g,function(d){e.push(parseInt(d,16))});return e}function toHex(){for(var d=[],d=1==arguments.length&&arguments[0].constructor==Array?arguments[0]:arguments,e="",f=0;f<d.length;f++)e+=(16>d[f]?"0":"")+d[f].toString(16);return e.toLowerCase()}var a=toNumbers("f655ba9d09a112d4968c63579db590b4"),b=toNumbers("98344c2eee86c3994890592585b49f80"),c=toNumbers("2ba806ecc19e2060e55cb72640373508");document.cookie="__test="+toHex(slowAES.decrypt(c,2,a,b))+"; expires=Thu, 31-Dec-37 23:55:55 GMT; path=/"; document.cookie="referrer="+escape(document.referrer); location.href="http://example.com/home.php?ckattempt=1";</script><noscript>This site requires Javascript to work, please enable Javascript in your browser or use a browser with Javascript support</noscript></body></html>
    
    
    I have no idea why this happen
     
    #3 k26646977, Apr 6, 2016
    Last edited by a moderator: Apr 6, 2016
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    653
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    You may need to further consult with the developer of the application, and with your hosting provider to determine how to best obtain the data you require. You may need to use a different method of fetching the data, or your hosting provider may need to determine why the content is not fetched.

    Thank you.
     
Loading...

Share This Page