-
Notifications
You must be signed in to change notification settings - Fork 25
GNSHttpProxy #94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
GNSHttpProxy #94
Conversation
…null pointer exception that arose when GNSHttpsServer called GNSHttpServer, but GNSHttpProxy was running before the requestHandler had been set.
… the default GNSHttpProxy port.
… remove duplicate code. Added system parameters to set the gns proxy's listening port and accepted remote hostnames.
…hostname to match the header for GNSHttpProxy.
…ording to coding standards.
…ttpProxyTest to automatically create a GNSHttpProxy when run.
…ive the proxy server a different default port from the http server, and moved HttpProxyTest to failingtests since it essentially just runs HttpClientTest, which is currently failing.
…ttpClientTest and HttpProxyTest relies on it.
…xing them both to work with changes in the master branch.
|
I'll take a look at this ASAP. I'm also adding @westyUMass |
|
Changes look good to me. Unless @westyUMass has something to say, I'll be merging this. |
|
I'm looking at this now. |
|
The one very minor quibble I see is in runServer which I know you didn't change. Arun added the suicide call which obviates the need for a loop. That could be simplified. That might lead to runServer becoming superfluous, but I'm not sure. Also, you could eliminate the single argument runServer method I think. |
Since I had to do some manually merging it might be difficult looking at changes in individual commits, so the following is a list of all files modified, and a summary of what was changed in the hopes that it makes things easier:
src/edu.umass.cs.gnsserver.httpserver.GNSHttpProxy: Created this class, which is used to run a GNSClient proxy that does not execute commands locally, but instead accepts requests over HTTP then uses a GNSClient to issue these commands to a GNSServer.
src/edu.umass.cs.gnsserver.httpserver.GNSHttpServer: Refactored this class to extend GNSHttpProxy to minimize code reuse.
src/edu.umass.cs.gnsserver.httpserver.GNSHttpsServer: Refactored this class to extend GNSHttpProxy to minimize code reuse.
src/edu.umass.cs.gnsclient.client.GNSClientConfig: Added variables that are used by the GNSHttpProxy
test/edu.umass.cs.gnsclient.client.singletests.HttpProxyTest: Created this test, which launches a GNSHttpProxy and a server, then runs HttpClientTest in order to test that the Proxy server correctly handles an http client.
test/edu.umass.cs.gnsclient.client.singletests.HttpClientTest: Modified a few variables in this class to be protected so that HttpProxyTest could extend this class, which minimizes code reuse.
The goal of creating GNSHttpProxy:
"The main difference between GNSHttpProxy and GNSHttpServer is that the proxy never executes and commands locally since it is intended to be used as a standalone client. An example use case would be having a GNSHttpProxy running on a Clearpass Authentication machine that is setup to only accept HTTP commands from localhost. Whenever the Clearpass server receives a user login event it sends an HTTP request to its local GNSHttpProxy to update a field in the user's GNS entry with their current location. This would solve the problem of having to spawn a new jvm every time an asynchronous event happens that requires a GNS read or write, but still gives the benefits of a distributed system since GNSHttpProxy uses a GNSClient."
In order to run the HttpProxyTest you can do: ant runtest -Dtest="HttpProxyTest"
This test is also included in "ant test" by default since it is located in the singletests folder.