http

Configuring lighttpd for many lightweight concurrent Keep-Alive http connections

I am using lighttpd as a front-end proxy to my custom HTTP based application server. I need to configure lighttpd for a large number (let's say around 5000) simultaneous http connections which have a large timeout and KeepAlive setting. Each connection will sit around mostly idle. Imagine an HTTP based chat server. My HTTP server is usi...

Google App Engine: How to pass value to my request handler?

Absolute beginner question: I have a template file index.html that looks like this: ... <FRAMESET ROWS="10%, *"> <FRAME SRC="/top_frame"> <FRAME SRC="{{ bottom_frame_url }}"> </FRAMESET> ... And a request handler for /top_frame that looks like this: class TopFrame(webapp.RequestHandler): def get(self): ... ...

html form submission in python and php is simple, can a novice do it in java?

I've made two versions of a script that submits a (https) web page form and collects the results. One version uses Snoopy.class in php, and the other uses urllib and urllib2 in python. Now I would like to make a java version. Snoopy makes the php version exceedingly easy to write, and it runs fine on my own (OS X) machine. But it alloca...

HttpURLConnection fail on Android

(Solved - see comment below) I have a class that implements a multipart file upload. The code works on every java client I've tried it on except for Android, and it's the only HTTP request code in my Android app that doesn't play nice with my back end service. The connection responseCode is "-1" so something pretty nasty is going on h...

How to redirect to a custom error page using mod_rewrite based on 404 error

Hi, I am trying to use mod_rewrite to be able to redirect to my custom html error page, when a 404 is returned. Right now, I have my http server running and my appserver(Websphere) running. When I take down a service on the appserver, it returns a message as follows: SRVE0255E: A WebGroup/Virtual Host to handle localhost:80 has not been...

How to download via HTTP only piece of big file with ruby

I only need to download the first few kilobytes of a file via HTTP. I tried require 'open-uri' url = 'http://example.com/big-file.dat' file = open(url) content = file.read(limit) But it actually downloads the full file. ...

Have a script to handle http errors.

I would like to have pretty 404 pages, as well as other error pages. I redirected all the errors (400, 401, 403, 404, 500, 502, 504) to my error.php. Apache provides a lot of information in $_SERVER variable. Do you know if there is good a ready script I can use for my error pages? ...

Unit testing with multiple collaborators

Today I ran into a very difficult TDD problem. I need to interact with a server through HTTP POSTs. I found the the Apache Commons HttpClient, which does what I need. However, I end up with a bunch of collaborating objects from Apache Commons: public void postMessage(String url, String message) throws Exception { PostMethod post =...

How to ensure http requests originate from a specific location?

HTTP Referer is the way I'm doing it at the moment. As everyone who's used this method knows it is not 100% accurate as the Referer header is optional and maybe fiddled with. Looking at how-to-ensure-access-to-my-web-service-from-my-code-only I'm still undsure of how to go about this in a minimal way. The situation: Advertising on som...

High-level HTTP client library for native C/C++ in Win32

Are there no "high-level" HTTP libraries for native C/C++ in Win32 or am I just looking in the wrong places? By "high-level" I mean an API that lets me do HTTP web requests/responses in C++ with "about the same" abstraction level as the .NET framework (but note that using C++/CLI is not an option for me). How to do something like this ...

Execute ClickOnce application located on share, through HTTP?

Hi, i have a ClickOnce application (online only) which is deployed on a network share. People can run the application by creating a shortcut to i:\ApplicationDirectory\ApplicationName.application where i is the letter of the drive of the networkshare. I want to start the application over HTTP. For this, I need the .Application file to...

Updating a http parent page from a https page via Javascript

Hi, I have a unsecure page which opens up a secure (https) page. The secure page needs to update the parent page via a javascript submit() while still remaining the current window. However when I try to do this via javascript I get an "Access Denied" javascript error because the parent page is unsecure. Any idea of how I can access th...

Protocol for data encoding for web<->desktop based application

Hello I'm planning to develop a remote desktop system consisting of: The desktop application that can grab and display the screen The server which establishes peer connections, serves STUN/TURN NAT traversal techniques for peer The web based (either Java applet or Silverlight) application that runs from browser and allows the user to...

Which one of the following is true when creating interfaces that alter data on the server?

I just finished a BrainBench test and for the life of my can't figure out the answer to this question...I don't think there is a correct answer. Choice 1 PUT requests need to be used; they are not repeatable. Choice 2 HEAD requests need to be used; they reduce data traffic. Choice 3 GET requests need to be used; they are easier to sen...

Can someone recommend a better alternative to InternetOpenUrl(..) ?

Environment: Win32 for Windows Mobile using C/C++ (VS2008) I need a clean and reliable method of updating some GPS coordinates (or other data) to a web server using http. Currently I've been using the following piece of code: wsprintf (threadParam.wszLocInfo, L"%s/LOGGPS/?U=%s&LAT=%.07f&LNG=%.07f&V=%s", ...); HANDLE hHTTPthread = Cr...

Problem with GWT App can't get HTTP Response back from Servlet on another server

I have Application written with GWT 1.7. I have one page where I upload file to the remote server that is on different domain. So, when I do Post to the server files goes to the server but when it's time to get response I'm getting null in following function: Servlet: ... resp.setStatus(HttpServletResponse.SC_CREATED); resp.getWriter()...

How can I mock a web server in Perl?

Our web application works together with several web-services which we can't influence. After each workflow (tested with Selenium) a hook call to a web-service occurs. I would like to mock that server. Ideally, I want a HTTP server object which I can start and kill at will, and an URL dispatcher which would call certain subroutines in my ...

Send a file via HTTP POST with C#

Hi everyone, I've been searching and reading around to that and couldn't fine anything really useful. I'm writing an small C# win app that allows user to send files to a web server, not by FTP, but by HTTP using POST. Think of it like a web form but running on a windows application. I have my HttpWebRequest object created using somethi...

Can One Domain Have Multiple Cookies?

Can one domain generate multiple cookies on visitor's web browser? If so, when user vists the website, which cookies will be delivered to server? And why would a website generate multiple cookies? I checked my Google Chrome Browser's Cookies settings, found that there are multiple cookies of nytimes.com. If server wants to store multip...

Java HTTP Proxy

I am working on a project where we'd like to pull content from one of our legacy applications, BUT, we'd like to avoid showing the "waiting for www.somehostname.com/someproduct/..." to the user. We can easily add another domain that points to the same server, but we still have the problem of the someproduct context root in the url. Sim...