HTTP Downloads :: Winsock

This is a discussion on HTTP Downloads :: Winsock within the Windows Programming forums, part of the Platform Specific Boards category; Hi. I am working on a project that includes downloading data from webservers. There is a problem. Some webservers rejects ...

  1. #1
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348

    HTTP Downloads :: Winsock

    Hi.

    I am working on a project that includes downloading data from webservers. There is a problem. Some webservers rejects the program request for data. In one example, the webserver responded with an error that the request was ignored because the client (program) is trying to access the data from another server. In terms of web browsers, this is like clicking on a link at www.google.com to download data from www.gamespot.com.

    To my understanding, the server is incorrect because the program is communicating directly to the server just as a web browser does. I would like to know how do web server such as the example know where the client originally found the link to the data?

    In the example above, is there any HTTP 1.1 code that I need to add to the request so that the server to process the request?

    Thanks,
    Kuphryn

  2. #2
    UNBANNED OneStiffRod's Avatar
    Join Date
    Jan 2002
    Posts
    669
    some servers have protections against others linking to their files to protect bandwith. I'm not an HTTP guru but maybe the server parses the request_hostname or something or IP if it's not local it refuses.

    I beleive there is an HTTP_REQUEST or something similar that might hold the info.

    Beyond that, the steps you would need to take our a Hackers territory.
    My Avatar says: "Stay in School"

    Rocco is the Boy!
    "SHUT YOUR LIPS..."

  3. #3
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    Okay. Thanks.

    Kuphryn

  4. #4
    I lurk
    Join Date
    Aug 2002
    Posts
    1,361
    I'm pretty sure it's the referrer which gets checked. If it's an off-site referrer, you get the error. If not, the file is sent.

    I'm not exactly sure where the referrer goes in your GET request... you could check the RFC.

    I'll capture a few packets and see.

  5. #5
    I lurk
    Join Date
    Aug 2002
    Posts
    1,361
    GET /images/hp0.gif HTTP/1.1
    Accept: */*
    Referer: http://www.google.ca
    Accept-Language: en-us

    That's what I got. Set the referer (hmm it's spelled wrong) to the website you're attempting to download from.

  6. #6
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    Okay. Thanks.

    I will first try the full URL including HTML file, i.e.

    www.google.com/something/index.html

    You solution is actually easier to implement though.

    Kuphryn

  7. #7
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    Okay. I have tried both solutions, but none worked. Here is an example of the request.

    Code:
    /GET http://visualparadox.com/images/no-l...roncall800.jpg HTTP/1.1
    Host: visualparadox.com
    Referer: http://visualparadox.com/wallpapers/coloroncall.htm
    Accept: text/plain, text/html
    Accept-Language: en-us
    Accept-Encoding: gzip
    Connection: Keep-Alive
    Again, the request above does not work. Here is one website I tested use to test the request.

    http://visualparadox.com/wallpapers/coloroncall.htm
    http://visualparadox.com/images/no-l...roncall800.jpg

    Kuphryn

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. HTTP get with winsock on rapidshare links???
    By Anddos in forum C++ Programming
    Replies: 1
    Last Post: 05-25-2009, 04:21 PM
  2. Standard HTTP Characters :: Winsock
    By kuphryn in forum Windows Programming
    Replies: 2
    Last Post: 01-12-2003, 12:21 PM
  3. HTTP GET Index Command :: Winsock
    By kuphryn in forum Windows Programming
    Replies: 2
    Last Post: 12-17-2002, 10:45 AM
  4. HTTP Protocol :: Winsock
    By kuphryn in forum Windows Programming
    Replies: 9
    Last Post: 06-21-2002, 04:07 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21