I would like to write tests for my client code, which accesses HTTP Server. I am looking for simple HTTP Server, which would simulate responses from real server.
Such HTTP Server (mock ... |
I am writing somewhat of a proxy program in Java. Here's how it works:
- The browser will be connected to the program.
- Any requests by the browser will be first be printed out ...
|
I'm planning on writing an RPC server in Java. The server needs to accept incoming RPCs - probably over HTTP - and answer them. Fairly basic stuff. Support for 'long polling' ... |
I am thinking that this would be an Apache server with some custom pages, or possibly a java application. Used for browser or http client testing, it should give me ... |
I want to read UTF-8 strings from a server that I have control of, using java MIDP.
My server is sending UTF-8 data.
The following code gets close:
...
|
Following on this question I am actually in the phase of finding the right HTTP container for one of my projects, too. I looked at several containers but I'm still ... |
I have a J2ME app running on my mobile phone(client),
I would like to open an HTTP connection with the server and keep polling for updated information on the server.
Every poll ... |
|
I love the idea of Grizzly, but I can't find any good examples to work with. Well, any good tutorial... I want to have an embedded HTTP server that ... |
I want to find about the HTTP 1.1 compression of the site I am talking to.
I need to do it programmatically in Java.
What I want to find out is:
Does the ... |
I am working on an applet that interfaces with a signature pad. The signature pad API has a function that returns a BufferedImage (assume its called API_CALL_TO_RETURN_BUFFERED_IMAGE()). I can ... |
I want to implement a Java HTTP server locally, I mean the server computer would be in my control. I'm expecting not more than 20 clients to send requests to it.
I ... |
could anyone recommend a good open source http proxy server written in java.
I've found some simple proxy servers consisting of just one java file but they don't always work. In particular ... |
|
What's the easiest way to create a simple HTTP server with Java? Are there any libraries in commons to facilitate this? I only need to respond to GET/POST, and I can't ... |
http://ooweb.sourceforge.net/tutorial.html
Also any way to change the logging file for the underlying Pygmy server?
Not really a question, but I can't seem to stop writing stuff like this. Maybe someone will ... |
I'm writing a monitor service for our EC2 based cluster, it task will be [connect via HTTP/S to our events servers each X(ms), verify they are alive, rest].
I need a toolkit ... |
I'm working on a software that does extensive queries to a database which is has a http interface. So my program parses and handles queries that are in form of long ... |
I'm implementing a Non-Blocking HTTP server in Java and decided to use pure Java NIO. I'm combining a NIO Selector with a small thread pool to perform the operations indicated by ... |
I have a Java client that uses HttpClient to connect to a server and wait a response. The response may return after a long time (the client essentially waits for an ... |
Does anyone know of a library that would allow me to tweak Apache HTTP Server parameters (such as Max Keep Alive or Max Clients) programmatically from withing Java code, ... |
I have HTML based queries in my code and one specific kind seems to give rise to IOExceptions upon receiving 505 response from the server. I have looked up the 505 ... |
Is there a way to create a very basic HTTP server (supporting only GET/POST) in Java using just the Java SE API, without writing code to manually parse HTTP requests and ... |
All Oauth providers I've authenticated with will redirect you to a page that says something like "Thanks, redirecting you..." and uses javascript to redirect you to the supplied redirect_uri.
I would have ... |
I am a student building a http proxy server. I want to cache those requests that are frequently accessed. May I get any idea about this? Especially in java.
|
I've just started looking at HTTP etc. and have written a simple Java Client that uses URLConnection to send a URL to a server and pulls down the index.html page (as ... |
I am currently trying to integrate a java applet with an ASP.NET site i am building..
The applet is built on the thinkmap SDK framework..
The applet starts successfully however it throws an ... |
I have a BufferedImage created using J2D in an applet.
I want to upload this BufferedImage using HTTP Post @ http://localhost:3001/upload/file.
EDIT: I have a ROR server handling the serverside of ... |
well, as i am doing a small project of coding an http server. the code is at
http://code.google.com/p/reactor/
the current puzzle is when asked to parse a page with java ... |
I have created the following test server using java:
import java.io.*;
import java.net.*;
class tcpServer{
public static void main(String args[]){
...
|
I'm writing an application which needs to be able to handle HTTP requests from an external source (in this case, it's actually a script from Second Life). I started out by ... |
Background: I'm writing a Java server application that needs to perform basic interactions with remote SCM systems served over http.
Is it possible to interact with Mercurial and Git repositories using some ... |
I am trying to figure out how to create a java program that can listen to multiple ports and perform different actions depending on which port the client speaks to.
I've seen ... |
I am not too familiar with HTML. I have a file structure on an HTML based server that is like:
folder A
->file 1,2,3,4,5...
folder b
.
.
.
How can I get the list of available ... |
I have an assignment to write a proxy server with java. I must be able to read and modify http headers and block some sites on a provided black-list.
I have ... |
I'm creating a personal tool that serves files through HTTP in Java.
For the HTTP Server part I'm using the com.sun.net.httpserver.HttpServer package.
When I connect from my own PC using either localhost or ... |
I start an Apache HTTP server within my Java program. Unfortunately, I cannot stop the server from the program through the "httpd.exe -k stop" command. The error message is "(OS 5)Access ... |
I am writing a http server in java using ServerSocket and Socket respectively.
In specification it says that the request can be of "chunked" type. So how could I enable this option ... |
How can we send user data to server using http protocol by using other than Query string ?
|
It's been working perfectly fine all day long, now suddenly I can't connect. I can connect through the browser (and so can you: http://secure.exoterragame.com/noxastra/login.php), but it won't work in ... |
I'm trying to create a http server in Java which is capable of providing keep-alive connections. I'm using the com.sun.net.httpserver.HttpServer class.
import java.io.IOException;
import java.io.OutputStream;
import java.net.InetSocketAddress;
import com.sun.net.httpserver.Headers;
import com.sun.net.httpserver.HttpExchange;
import com.sun.net.httpserver.HttpHandler;
import com.sun.net.httpserver.HttpServer;
public class httpHandler implements ...
|
I am trying to send an XML file to my RESTful web server, and receive a XML file in return, however, I am getting a 500 error.
java.io.IOException: Server returned ... |
I've just wrote an HTTP server that receive POST request via HTTP. In particular it receives requests as multipart form data:
POST / HTTP/1.1
Host: 192.168.7.4:5000
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0
Accept: ...
|
I need to coding an Http Client using java which interact with a stateful http server. The client needs to
- navigate to login page and accept cookies
- submit login page with http ...
|
Using the ElementalHttpServer example class found here:
http://hc.apache.org/httpcomponents-core-ga/httpcore/examples/org/apache/http/examples/ElementalHttpServer.java
I am able to successfully receive post data, my goal is to convert the received post data into a string I can print. ... |
I have a piece of code to connect to a Socket server, and it works fine.
Socket socket = new Socket();
socket.connect(new InetSocketAddress(address, port));
Now I want to connect via a HTTP proxy, what ... |
long time reader, first time asking question here.
The situation: we have a server and nodes architecture, where the nodes can be on the same or different machine and are used for ... |
I'm trying to send a HTTP POST request to a Google server and get the response. I'm trying to send the exact same request that my browser would send. When I ... |
So I have an assignment where I have to make a HTTP Server with chosen programming language. No big deal. I have encountered a problem that I cant seem to figure ... |
I know that, the http clients sends 0x10 0x13 bytes to inform the http server that the request data has finished.
But how the server informs the http clients that ... |
I'm trying to make a simple HTML server that will read a request from my browser, parse the requested file from the request, then serve the appropriate HTML back to the ... |
I have a simple HTML server program that listens on port 8000 for a request. I want to be able to request an HTML file from the server program and send ... |
i try run code copied from this tutorial
http://www.developer.nokia.com/Community/Wiki/How_to_use_Http_POST_request_in_Java_ME
But when i run it i get Exception in source code line
dis = new DataInputStream(hc.openInputStream());
java.io.IOException: 40-Error in HTTP operation
...
|
I config a apache http server to rewrite the incoming request and redirect it to
local file, this apache serve running as the front-end of a jboss server and connect with ... |
I need to write a Java client application which, when given the below URL, will enumerate the directories/files recursively beneath it. I also need to get the last modified timestamp ... |
I'm trying to make a simple http client server using java. It will show the client's request as well as the server's response. For example server will send back
...
|
I'm looking for a light-weight embeddable http server in java.
Ideally it should scalable and be able to handle 1000 connections per sec.
[EDIT]
Another condition : production ready.
Have you got any idea ?
... |
|
hi, I've wriiten a small application(using sockets) which mediates between browser and the proxy server. I reads data from browser, send it to proxy. read response from proxy and send it to browser.It works fine with GET method, but when i use POST method, it goes into blocked read call for proxy. for Yahoo it says "ur browser doesn't support cookies". ... |
Have another look at your server's readLine loop -- it will loop until the method returns null, i.e. until your client close()s the connection. Compare this with the client's request code. It tries to read back the server response before it ever comes around to close()ing the request. Deadlock. Before you implement a request/response protocol, however simple, never start with code. ... |
Hello Every one... Here i have a problem which may have lots of interest among all the java folks on networking. I had an applet which opens a Socket connection to a Server on its running port. I am using a PrintWriter object to write the protocol String like GET/index.html HTTP/1.1 to it. Then i have one BufferedReader to get all ... |
|
Hi, I'm quite new to Java in general, and I've never worked with anything that has to do with networks. Now I want to build a little server which should be able to return whole files to a php script on a server. I can't just use servlets because my server has to do something(would be a bit complicated to explain), ... |
I am trying to make a HTTP request through our corporate firewall which uses Kerberos authentication. The proxy consistently rejects my request with a 407 (unauthorised error). From what I have read the settings to gain authentication from proxy servers are dependant on the proxy we are using and are not documented. I have tried many combinations of settings in my ... |
Hi, I have multiple threads that use a set of httpurlconnections. I read the contents line by line. From each line , I pick a particular value based on a criteria and put this into a file. FOr example I open 5 httpurlconnections as threads and pick values from each urlconnection based on a criteria. These values are then written into ... |
|
Hi, I am a bit confuse about the handling of request and response by the server on HTTP Protocol. Earlier i believed that whenever there is some request generated to server, the server maintain some data structure in itself, having all the request information (ip address etc) and then using that DATA STRUCTURE info, the server sends back the response. But, ... |
|
|
Hi I'm creating a simple HTTP client and Server that supports GET and PUT requests. For the client side I'm using a DataOutputStream to send the request and the file for a PUT request. I'm having trouble retrieving this on the server side though. I attempted to use a BufferedReader and I read the first line of the response, and then ... |
Hi, I desperate need help. I am trying to load a file from my client application to send to my server side API though a URL connection. The problem is that on the server side i am not able to catch the inputstream in the response. Can anyone please help, am I doing this correctly? here is my code CLIENT SIDE=> ... |
Hello All I am facing problems in Applet-Servlet communication. I open a HttpURLConnection --> get outputstream --> write object on it. Then i want to read the response from servlet on same connection after getting the input stream. BUT i face an exception doing this. Can someone help me out. Here is the code snippet along with the stacktrace. URL url ... |
Assuming this your firewall setup is to have the firewall machine between the two networks, you need to set up a ServerSocket facing the outside world (the side making HTTP requests) on port 80 and listen for connections. When you get a connection, you open a socket to the real web server on the other network niterface (unless you wish to ... |
|
I agree with Frank. Writing is simple HTTP request processor is quite easy. Sun supplied a good one in one of internal undocumented packages, but for some reason withdrew it recently. Creation of HTTP client is a bit more work, but httpurlconnection is working in most cases. Writing your own server can be even preferable because you can control keep-alive in ... |
Hi, I have read two threadS here on this but both seemed inconclusive, hence posting a new one. Here're the deatils: Objects: ------- I have an Applet that calls a Servlet. The Servlet in turn calls a utility class. The utility class generates random logging messages. Flow: ----- The Applet passes data to the servlet in onMigrate() method. The Servlet instantiates ... |
Dear Amol Sir, This is exception which i found in the error log.Please look in to and advise me how i will resolve it. Thanks a lot in Advance. ----- Root Cause ----- java.lang.UnsupportedClassVersionError: customerserviceServlet/NewPasswordServlet (Unsupported major.minor version 49.0) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:539) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1717) at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:983) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1431) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1301) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:870) at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:658) at org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:413) at ... |
Hi, I am working with a java program which looks for file(s) in a given directory whose name(s) starts with a specific string and lists them on the webpage provided links to the same. I have written the following method to fulfill this. private void FileList() { try { int index=0; File aDirectory = new File("C:/temp"); String[] filesInDir = aDirectory.list(); Arrays.sort(filesInDir); ... |
Which type of client/server application you are talking about? Any way, your proxy application must be able to be authenticated into the on-going messages from the clients, as an intercepting filter. You have to implement the interceptor pattern to complete this. Please provide more details about how you are going to make this, so we can help you on that. Cheers, ... |
Response code 500 means that there was an error on the server. I didn't notice anything in your post which said you looked in the server's logs to find out what the error was. (Sorry if I missed it, if you did say that.) Anyway, that's what you should do. It's possible the error was caused by your applet sending a ... |
Hi all any help with this would be appreciated. I have embarked on trying to make a new mobile product, and while i have been researching Java Card technology, i need a server that can handle all these requests that i send. Basically from what i have picked up in my research is that i need to create a Http server ... |
|
hi, i'm using httpclient 4 to communicate with a http server. when i send a request it gives me the result in such format: artist="XYZ" song="ABC" the problem is that it sends utf-8 encodet (eg. sven v\u00e4th as artist) how can i convert this to get displayed correctly? when i try it with: String artist = "vth"; it works i even ... |
Hi, i have a http server which gives me some media files (mp3 etc.) i use JLayer to play the media files which works fine the big problem is that some files are really big and the Player class just wont stop downloading them when i hit the "stop" button i have no idea what could going on... JLayer uses a ... |
We are trying to work out how to pass on a request to an external server and catch the response in code. The situation is this: Most users need authenticating against AD, but some we'll handle differently. Our server doesn't have access into our corporate domain so can't authenticate users against Active Directory. We have been supplied with an aspx page ... |
|
server java HTTP request Can anyone know how to fill the blanks please? HttpRequest.java This is the code for the HttpRequest class that you will need to complete for part 2. The code for the other classes is provided on this page. /************************************* * Filename: HttpRequest.java * Names: * Student-IDs: * Date: *************************************/ import java.net.*; import java.io.*; import java.util.*; ... |
Hi this is my code, I am trying to send image in my filesystem to tomcat server running at port 8080. While running this code, I am not getting any exception. But I didnt got the image in my destination. String uploadUrl = "http://localhost:8080/images"; String targetFileName = "blue.jpg"; URL url; HttpURLConnection connection = null; try { //Create connection url = new ... |
|
I realize there was a thread that had this subject, but it's out of date and not the same exception. We have a server that started returning an HTTP 500 error. The lead programmer is out for extended leave, so they wanted me to investigate. When I traced it back, this is the message that was stored: type Exception report message ... |
Hello, I am using embded oracle oc4j server and getting following exception, and I cant fine httpd.conf file to increase KeepTimeout ERROR : HttpRequestHandler-1229 com.tcs.sgv.common.exception.BaseException - The stack trace is: com.evermind.server.http.HttpIOException: Read timed out at com.evermind.server.http.EvermindServletInputStream.read(EvermindServletInputStream.java:92) at javax.servlet.ServletInputStream.readLine(ServletInputStream.java:138) at com.hhc.MultipartInputStreamHandler.readLine(MultipartRequest.java:831) at com.hhc.MultipartInputStreamHandler.readLine(MultipartRequest.java:808) at com.hhc.MultipartRequest.readRequest(MultipartRequest.java:394) at com.hhc.MultipartRequest.(MultipartRequest.java:222) at com.tcs.sgv.fms.requesthandler.NotingRequestHandler.getNotings(NotingRequestHandler.java:1250) at com.tcs.sgv.fms.requesthandler.NotingRequestHandler.processRequest(NotingRequestHandler.java:304) at com.tcs.sgv.common.servlet.FrontServlet.processRequest(FrontServlet.java:171) at com.tcs.sgv.common.servlet.FrontServlet.doPost(FrontServlet.java:112) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:778) at ... |
|
Guys, i need to implement a program that will send request to the server and recieve the http response from the server. Some of information will attached in the http response from the server. My application must able to catch out this info in the http response header. I had use the httpClient jar to send the request and i able ... |
|
Guys i have successfully installed the whole bundle the gui for the application server did come up i swear... Now its giving me an http error anybody got any input on this pps its not my browser settings i don't think security is set to low... IT keeps giving me the requested resource is not available () Tried uninstalling reinstalling everything/.... ... |
Dan06 wrote: 1. Is my code conceptually correct? Not sure what you mean by "conceptually". I'm pretty sure it isn't correct, as in, it won't work. In terms of concepts, yeah, you have to send the data from the file, but there's probably some other things you have to do to make a proper multipart form-data upload. 2. How can I ... |
Hi I am working with the Tomcat 5.5 on Eclipse, and is getting the error when my servlet calls the jsp using request dispatcher, the error is: HTTP status 500 The server encountered an internal error () that prevented it from fulfilling this request. and the log of the exception is: Oct 27, 2008 9:41:15 AM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for ... |
The result here is that for each image i have in the html I see a "HERE!!!" and I assume it means that a new socket has been opened because I don't think this 'simple' httpserver has any logic inside to sniff the the requests sent in an 'used' socket and call handle reusing the socket. I hope you understand what ... |
P.S. If you don't have any suggestions in this regard, do you know how I may decode URL-encoded strings (without having to write from scratch) for example: "username=Pok%26%23233%3Bmon+Master&password=pikachu&submit=Log+In" or "username=Pok%26eacute%3Bmon+Master&password=pikachu&submit=Log+In" (the former would be sent by FireFox and the later by IE8) should turn in to a Map (or other data structure): "username" -> "Pokmon Master" "password" -> "pikachu" "submit" -> ... |
Not sure if that is the case. This Java application is basically a HTTP Proxy. It passes all the http headers to the server that it receives for the Request from a client. From my understanding, the only difference between the request coming out from the Proxy vs directly from the client, is the source IP. |
You're probably better off asking this in a forum specifically about that server. Though as I recall, PUT is disabled by default in SunOne. But that was a while ago so maybe I've forgotten or things have changed. Have you actually tried doing a PUT to the server to see what happens? |