http

Customizing an existing handler in Go's http library.

With the following being defined as is noted in the http library: func Handle(pattern string, handler Handler) type Handler interface { ServeHTTP(*Conn, *Request) } How can I improve upon an existing handler (say, websocket.Draft75Handler for instance) by giving it an additional argument (and tell it what to do with the argument)? I'...

Mina - HTTP Proxy – what is AbstractHttpLogicHandler for?

I am currently working on building a simple HTTP proxy using Apache Mina, in particular org.apache.mina.proxy, and I have a few questions about how to use some of the components. How do I extract the future address from an incoming HTTP request? I can see how to create a ProxyConnection given a URL, but I can't see how to extract thi...

secure web application questions

I am implementing a web application which is powered on the backend via a soap server/client interaction. The web site is running over https and authentication is being provided by LDAP. As of now I push all users without a cookie, call it 'userHash' for reference to the login page. The login page accepts a username, pass and checks...

Apache mod_expires question

Hi Folks, I'm really confused by all that caching stuff. I'm trying to setup mod_expires to reduce the number of HTTP Requests from my website to the server. I did well so far, I installed mod_expires and wrote a little .conf file from the instructions on http://httpd.apache.org/docs/2.0/mod/mod_expires.html. Now, for instance, all my...

Put username in apache access_log with PHP and without HTTP auth

In the Apache log configuration it is possible to specify that the HTTP auth user name should be logged. Most PHP scripts have their own, cookie-based authentication. Is it possible in PHP to provide Apache with a HTTP auth username for logging purposes, even if the authentication is cookie-based? If yes, how would the code look like? If...

Struts2: Session Problem (after reverse proxy)

I store session parameters in a Struts2 session map that I get in my actions using the SessionAware interface. My Application is in the /MyApp path. After setting up the struts2 application on an Apache server with an inverse proxy redirect that makes the URL http://www.appdomain.com/ point to my local tomcat on localhost:8080/MyApp, St...

Are there user agents that add whitespace to text sent over HTTP?

This is more of a technical question than a help question. I'm not interested in knowing if I should trim() my input. Are there any user agents (browsers) that add whitespace to text sent over HTTP? I'm wondering in some cases if trim() is necessary (aside from users adding whitespace) because I've never actually seen a browser add anyt...

simple http server

I have a server client application. The clients sends the server http posts with info every second or so. The server is implemented using C#, there server doesn't need to respond in any way to the client. Whats the easiest and most practical way to get this done? Is there some kind of library that is easy to use that I can import into ...

How to use separate thread to perform http requests

I have an application that is performing HTTP Requests (specifically calling the FogBugz API) when the user clicks certain buttons. Right now, I am just creating a service when the application starts, and then calling different methods in that service to complete requests. However, when I do this, there is the usual hang in the UI thread...

Enable gzip compression in a Grok - Zope - PasteScript environment

Hello everyone! I am trying to make my server send gzipped data. I have a grok application that runs over Paste (Paste-1.7.2-py2.4.egg) I have been trying to google how to make all that environment to serve data in gzip... But without success... I think the answer comes in http://pythonpaste.org/modules/gzipper.html but if I do this: ...

Send message from linux terminal to some web server

I am trying to figure out how I can post a message to an http server from the linux shell. What I want is for the shell to post the message and then I can write a small php program to reroute the message to its intended recipient based on the contents and the sender. I cant seem to find a command to do this in Linux. I would really li...

Utility to simulate simple http responses

I'm doing quite a lot of work with a javascript messaging system at the moment and end up making lots of use of netcat scripts to monitor and simulate as yet unimplemented server responses. Does anyone know of a utility that can easily manage this sort of thing for prototyping purposes other than setting up a full webserver? ...

Capturing cookie responses in C#

Using Web Browser control or http request in C#, when a website creates a cookie (or tries to), is there a way to capture and display that cookie? ...

International characters in filename in mutipart formdata

I am using Apache HTTP components (4.1-alpha2) to upload a files to dropbox. This is done using multipart form data. What is the correct way to encode filenames in in a multipart form that contain international (non-ascii) characters? If I use there standard API, the server returns an HTTP status Forbidden. If I modify the upload code s...

How to read only first n bytes from http upload and break it?

I do not want to let user to upload full file. I desire to limit it to first n bytes. I need just file header not a full file and I want to prevent browser from sending all data. For example mp3 file is 1MB long and I want to read just first 1024 bytes of it on server side. Is it possible to save transfer by breaking it at some point? I ...

Handling HTTP request

If there is a HTTP request coming to a web server from many clients the requests will be handled in the order. For all the http request i want to use a token bucket system. So when there is a first Request i write a number to a file and increment the number for the next request and so on.. I dont want to do it in DB since the DB size i...

Will sending an HTTP Header with Accept: text/html only download text from the page?

I'm writing a simple crawler, and ideally to save bandwidth, I'd only like to download the text and links on the page. Can I do that using HTTP Headers? I'm confused about how they work. ...

php parameters over specific port

I have a php page http://mydomain.com/mypage.php this page will be accessible by public and our partner. my partner is supposed to send a POST request over port 7333 to http://mydomain.com:7333/mypage.php . now how can i accept the parameters if and only if they came over port 7333. i want to distinguish between parameters that are comin...

Proper way to process html form in BaseHTTPHandler

I know that I am supposed to use cgi.FieldStorage for that. But what do I initialize it with? def do_GET(self): form = cgi.FieldStorage(WHAT SHOULD BE HERE?!) thanks! I did search, but didn't find an answer :( ...

How to throw HTTP errors?

I am using Response.Redirect to redirect the user to a new page but I want the page to be shown only if there is a particular parameter in the query string. Otherwise, I want an HTTP 401 authentication error page to be shown. Can that be done? If yes, how? If not, why not? ...