Permalink
Browse files

Tweaks for site deployment

  • Loading branch information...
1 parent 07542d1 commit 89b468ec0d3cedd55359acc9e7653122dcbfdaa5 Adam Fisk committed Jun 27, 2012
@@ -277,10 +277,22 @@ public void operationComplete(final ChannelFuture cf)
else {
log.debug("Channel not open. Connected? {}",
browserToProxyChannel.isConnected());
- // This will undoubtedly happen anyway, but just in case.
if (me.getChannel().isConnected()) {
- log.warn("Closing channel to remote server -- received a " +
- "response after the browser connection is closed?");
+ // This can happen with thing like Google's auto-suggest, for
+ // example -- when the user presses backspace, the browser
+ // seems to close the connection for that request, sometimes
+ // before the response has come through -- i.e. cases where
+ // the browser knows it doesn't care about the response
+ // anymore.
+
+ // Can also happen when the user browses to another page
+ // before a page has completely loaded -- lots of cases really.
+ log.info("Closing channel to remote server -- received a " +
+ "response after the browser connection is closed? " +
+ "Current request:\n{}\nResponse:\n{}",
+ this.currentHttpRequest, me.getMessage());
+
+ // This will undoubtedly happen anyway, but just in case.
me.getChannel().close();
}
}
@@ -381,6 +381,10 @@ public static String parseHostAndPort(final String uri) {
}
public static String parseHost(final HttpRequest request) {
+ final String host = request.getHeader(HttpHeaders.Names.HOST);
+ if (StringUtils.isNotBlank(host)) {
+ return host;
+ }
return parseHost(request.getUri());
}
@@ -1,96 +0,0 @@
-LittleProxy
-
- LittleProxy is a high-performance HTTP proxy written in Java atop Trustin Lee's {{{http://jboss.org/netty}Netty}} framework. It's a side-project of {{{http://www.littleshoot.org}LittleShoot}} and the Brave New Software Project. While many may still think of "high-performance" and "Java" as a contradiction in terms, the JVM has made astonishing strides over the years. That combined with Netty's use of event-based IO means that LittleProxy outperforms mod_proxy in every test we've ever run, beating it by as much as 83% on some tests using Apache Benchmark. LittleProxy is still a young project, but it works well.
-
- LittleProxy is open source and used the Apache 2 license. If you would like to use LittleProxy under another license, please contact us at littleproxy at littleshoot.org or inquire on the forum.
-
- To run LittleProxy, you need two things: Java and {{{http://http://maven.apache.org/}maven}}.
-
- Enjoy, and please let us know if you have any issues over on the LittleProxy {{{http://groups.google.com/group/littleproxy}discussion group}}.
-
-* Quick Start - Run from Source
-
- You can either run LittleProxy directly from source or you can include the LittleProxy jar via maven or direct download.
-
- To run from the source, do the following:
-
-+-----+
- $ git clone git://github.com/adamfisk/LittleProxy.git
- $ cd LittleProxy
- $ ./run.bash &> out.txt &
-+-----+
-
-* Quick Start - Maven
-
- To include the LittleProxy jar in your maven project, simply add it as a dependency, as shown below. LittleProxy releases are synced with the Maven Central Repository.
-
-+-----+
- <dependencies>
- ...
- <dependency>
- <groupId>org.littleshoot</groupId>
- <artifactId>littleproxy</artifactId>
- <version>0.4</version>
- </dependency>
- </dependencies>
-
- ...
-
- <repositories>
- ...
- <repository>
- <id>littleshoot</id>
- <name>LittleShoot Repository</name>
- <url>http://svn.littleshoot.org/maven</url>
- </repository>
- </repositories>
-+-----+
-
- If you want to run SNAPSHOT versions of LittleProxy for any reason, you need to add the Sonatype Nexus Snapshot repository. Along with the LittleProxy snapshot dependency, you would do that as follows:
-
-+-----+
- <dependencies>
- ...
- <dependency>
- <groupId>org.littleshoot</groupId>
- <artifactId>littleproxy</artifactId>
- <version>0.5-SNAPSHOT</version>
- </dependency>
- </dependencies>
-
- ...
-
- <repositories>
- ...
- <repository>
- <id>sonatype-nexus-snapshots</id>
- <name>Sonatype Nexus Snapshots</name>
- <url>https://oss.sonatype.org/content/repositories/snapshots</url>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </repository>
- </repositories>
-+-----+
-
-
- Once you've included LittleProxy, you can start the server with the following:
-
-+-----+
-final HttpProxyServer server = new DefaultHttpProxyServer(8080);
-server.start();
-+-----+
-
-
- There are lots of filters and such you can also add to LittleProxy. If you run into any issues, please add them to GitHub at
-
-{{https://github.com/adamfisk/LittleProxy/issues}}
-
- If you have any other questions, please visit our forum here:
-
-{{https://groups.google.com/forum/#!forum/littleproxy}}
-
-
View
@@ -1,38 +1,20 @@
-<!--<project xmlns="http://maven.apache.org/DECORATION/1.0.0"
+<project xmlns="http://maven.apache.org/DECORATION/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/DECORATION/1.0.0 http://maven.apache.org/xsd/decoration-1.0.0.xsd">
--->
-<project name="LittleProxy HTTP Proxy">
-
- <poweredBy>
- <logo name="LittleShoot" href="http://www.littleshoot.org/"
- img="http://dev.littleshoot.org:8084/download/attachments/131074/global.logo?version=1&amp;modificationDate=1256417571000"/>
- </poweredBy>
-
<body>
- <head>
-<script type="text/javascript">
-
- var _gaq = _gaq || [];
- _gaq.push(['_setAccount', 'UA-3025934-2']);
- _gaq.push(['_trackPageview']);
-
- (function() {
- var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
- ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
- var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
- })();
-
-</script>
- </head>
-
-<!--
<menu name="Overview">
- <item name="Introduction" href="index.html"/>
+ <item name="Source Repository" href="source-repository.html"/>
+ <item name="Issue Tracking" href="issue-tracking.html"/>
+ <item name="Dependencies" href="dependencies.html"/>
+ <item name="JavaDocs" href="apidocs/index.html"/>
+ <item name="Test JavaDocs" href="testapidocs/index.html"/>
+ <item name="Test Report" href="surefire-report.html"/>
+ <item name="Checkstyle" href="checkstyle.html"/>
+ <item name="Change Log" href="changelog.html"/>
+ <item name="Find Bugs Report" href="findbugs.html"/>
+ <item name="PMD Report" href="pmd.html"/>
+ <item name="CPD Report" href="cpd.html"/>
+ <item name="File Activity" href="file-activity.html"/>
</menu>
--->
-
- <menu ref="reports"/>
-
</body>
</project>

0 comments on commit 89b468e

Please sign in to comment.