http-headers

Can I host two separate web servers on a LAN to the outside world through 1 IP address?

I am a web programmer with a home web dev operation. I have multiple web servers in my house on a FIOS connection. I have my own domain pointed to my router through dyndns.org's custom domain service. My ISP gives me ONE static IP address, which at the moment allows me to configure my router to direct outbound web traffic from one serve...

HTTP authentication logout via PHP

What is the correct way to log out of HTTP authentication protected folder? There are workarounds that can achieve this, but they are potentially dangerous because they can be buggy or don't work in certain situations / browsers. That is why I am looking for correct and clean solution. ...

using Live HTTP Headers

On a website, I enter some parameters in a form, click on search and then get a page with a message "retrieving your results". After the search is complete, I get another page with my results displayed. I am trying to recreate this programatically and I used Live HTTP Headers to get a peek of what is going on behind i.e the url, form ...

Is it possible to implement X-HTTP-Method-Override in ASP.NET MVC?

I'm implementing a prototype of a RESTful API using ASP.NET MVC and apart from the odd bug here and there I've achieve all the requirements I set out at the start, apart from callers being able to use the X-HTTP-Method-Override custom header to override the HTTP method. What I'd like is that the following request... GET /someresource/1...

How to determine if a given URL link is a video or image?

I'm trying to take a given URL entered by user and determine if the URL is pointing to a image or a video. Example use case. When a user paste in the URL of a youtube video, on save the page will auto display the embedded Youtube player. When a user poaste int he URL of a picture in flickr, on save, the page will auto display a small...

How to modify the header of a HttpUrlConnection

Im trying to improve the Java Html Document a little but i'm running into problems with the HttpUrlConntion. One thing is that some servers block a request if the user agent is a Java VM. Another problem is that the HttpUrlConnection does not set the Referrer or Location header field. Since several sites use these fields to verify that t...

Any insight into using Google Wireless Transcoder?

I was recently asked to "just stick a link at the top" of one of our sites to offer hand held users the use of http://stackoverflow.com">Google's Wireless Transcoder. Initially I was skeptical but as I started to look into it I became intrigued that this could save me a lot of work. Though I'd love to implement a hand held solution for ...

How can I keep an IE page request alive more than 1 minute?

If you are connected to the Internet directly (and not through a proxy) and requests for a page (get/post) in Internet Explorer 7, the default time-out is 1 minute. If the response from the web server takes more than a minute then you end up getting a "Network error" from IE. How can I increase this timeout in IE? Microsoft has docume...

How to instruct web browsers NOT to cache pages?

I've got a caching problem with the Internet Explorer 6.0 and I want to instruct the browser not to cache the page he's requesting. Further information: In my page, there's a random token that prevents reloading the site and posting the same information twice or more. If you now bookmark this page, the browser has to be instructed to r...

Whats the best way of caching images on my website ?

I have a website www.somesite1.com which gets all its image content from www.somesite2.com At the moment each time an image is to be displayed we simply use an absolute URL to get it like this <img src="http://www.somesite2.com/images/myimage.jpg" /> So each time a user goes to www.somesite1.com for content www.somesite2.com gets...

yslow still not giving me an A for expires header in apache httpd even though I added them

Hi, trying to add an ExpiresDefault ExpiresByType to content on my website so that way it is cached. I use cachebusting in the URL (a revision number in the path) for Javascript, CSS, and images so that way I can set it to forever for these mimetypes. I have the following rules set up in apache httpd: ExpiresActive On ExpiresDefault...

Is there any efficient way to extract multipart range response of http request?

I am doing some http request with WinHttp.lib, while Get data with Range header, such as "GET someURL\r\n Range: bytes=4096-8191,0-4095", received the respone data after response header like this(according to RFC2616): ================================ --46228a661764c4210 Content-type: text/plain Content-range: bytes 4096-8191/1406...

How to escape a line break literal in the HTTP header?

In the HTTP header, line breaks are tokens to separate fields in the header. But, if I wan't to send a line break literal in a custom field how should I escape it? ...

Is it possible to change headers order using HttpWebRequest?

I need to change the order of headers, I'm using this: HttpWebRequest request = (HttpWebRequest)WebRequest.Create(URL); request.Method = context.Request.HttpMethod; request.UserAgent = context.Request.UserAgent; The output for that is: GET /* HTTP/1.1 User-Agent: My Server Host: 127.0.0.1:1080 But it should be GET /* HTTP/1.1 Host...

Getting the client IP address: REMOTE_ADDR, HTTP_X_FORWARDED_FOR, what else could be useful?

I understand it's a standard practice to look at both these variables. Of course they can easily be spoofed. I'm curious how often can you expect these values (especially the HTTP_X_FORWARDED_FOR) to contain genuine information and not just be scrambled or have their values stripped away? Anyone with the experience or statistics on this...

Differentiate nginx behaviour depending on URL

I have a Django application and I use nginx to serve static content. Unfortunately, all registered MIME types get displayed in client browser, while I would like to give an ability to download the same content, along with usual behaviour. Say, I have JPEG file under /media/images/image01.jpg and I want that nginx serves this file in usua...

Retrieving Client Information from web service request

If i have an applicataion requesting a service, is it possible for the web service to determine the name of the application or does this have to be sent within the request? ...

PHP Pass File Handle to user so that file downloads & saves to their machine

Hello all, I am downloading a file from another server. I wish to push this file to my users rather than saving it to my server. In other words, pass them the file handle so it just passes through my server and saves to their machine. How can I do this? I have this so far: $handle = fopen($_GET['fileURL'], 'r'); $filename = stream_ge...

Renaming File on another server as user downloads it [2] - using PHP

I have asked this question today already but this time I want to know if I can achieve this via PHP since Javascript wasn't up to it. I have a link to a file on another server. If i provide this link to my users the headers are pushed out to download that file from that server. Is there a way for me to capture those headers and file an...

changing the request headers for the page that is being loaded in an iframe

I am using Appweb server (mini http server) and facing an issue while opening a webpage using https. The page is getting truncated and when looked at HTTP response headers found that webserver is sending response in chunks (Transfer-Encoding set) and that is the root cause. It seems to be a bug in webserver. I built webserver again disa...