Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Minimalistic SPDY proxy setup using Jetty 9.0.0

Hi Thomas, thanks for your reply.

Yes, I have read the SPDY proxy example documentation.

I am using jetty-9.0.0.v20130308 .

This is my start.ini:
--exec
-Xbootclasspath/p:lib/npn-boot-1.1.2.v20130305.jar
OPTIONS=Server,ext,spdy
etc/jetty.xml
etc/jetty-spdy-proxy.xml

I have not touched the etc/jetty.xml file.
This is in etc/jetty-spdy-proxy.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">

<Configure id="Server" class="org.eclipse.jetty.server.Server">

  <New id="sslContextFactory" class="org.eclipse.jetty.util.ssl.SslContextFactory">
    <Set name="KeyStorePath"><Property name="jetty.home" default="." />/etc/keystore</Set>
    <Set name="KeyStorePassword">OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4</Set>
    <Set name="KeyManagerPassword">OBF:1u2u1wml1z7s1z7a1wnl1u2g</Set>
    <Set name="TrustStorePath"><Property name="jetty.home" default="." />/etc/keystore</Set>
    <Set name="TrustStorePassword">OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4</Set>
  </New>

  <New id="tlsHttpConfig" class="org.eclipse.jetty.server.HttpConfiguration">
    <Arg><Ref refid="httpConfig"/></Arg>
    <Call name="addCustomizer">
      <Arg><New class="org.eclipse.jetty.server.SecureRequestCustomizer"/></Arg>
    </Call>
  </New>

  <New id="spdyProxyEngine" class="org.eclipse.jetty.spdy.server.proxy.SPDYProxyEngine">
    <Arg>
      <New class="org.eclipse.jetty.spdy.client.SPDYClient$Factory">
        <Call name="start"/>
      </New>
    </Arg>
  </New>

  <New id="proxyEngineSelector" class="org.eclipse.jetty.spdy.server.proxy.ProxyEngineSelector">
    <Call name="putProxyEngine">
      <Arg>spdy/3</Arg>
      <Arg>
        <Ref refid="spdyProxyEngine"/>
      </Arg>
    </Call>
    <Set name="proxyServerInfos">
      <Map>
        <Entry>
          <Item>localhost</Item>
          <Item>
            <New class="org.eclipse.jetty.spdy.server.proxy.ProxyEngineSelector$ProxyServerInfo">
              <Arg type="String">spdy/3</Arg>
              <Arg>127.0.0.1</Arg>
              <Arg type="int">7070</Arg>
            </New>
          </Item>
        </Entry>
      </Map>
    </Set>
  </New>

  <Call name="addConnector">
    <Arg>
      <New class="org.eclipse.jetty.spdy.server.proxy.HTTPSPDYProxyServerConnector">
        <Arg>
          <Ref refid="Server"/>
        </Arg>
        <Arg>
          <Ref refid="proxyEngineSelector"/>
        </Arg>
        <Set name="Port">8080</Set>
      </New>
    </Arg>
  </Call>
  <Call name="addConnector">
    <Arg>
      <New class="org.eclipse.jetty.spdy.server.proxy.HTTPSPDYProxyServerConnector">
        <Arg>
          <Ref refid="Server"/>
        </Arg>
        <Arg>
          <Ref refid="sslContextFactory"/>
        </Arg>
        <Arg>
          <Ref refid="proxyEngineSelector"/>
        </Arg>
        <Set name="Port">8443</Set>
      </New>
    </Arg>
  </Call>

</Configure>

I have not changed the sslContextFactory configuration (is straight from the distribution).
Now, to try this out, I am running an HTTP server on the same machine as the SPDY proxy, listening on port 7070. The proxy is started with: java -jar start.jar. In my chrome browser, on the same machine, I go to https://localhost:8443/ . No result in the browser (keeps loading). No incoming request for the HTTP server on 7070.

Jetty output at this point:
$ java -jar start.jar
2013-03-11 22:21:29.421:INFO:oejs.Server:main: jetty-9.0.0.v20130308
2013-03-11 22:21:29.535:INFO:oejssp.HTTPSPDYProxyServerConnector:main: Started HTTPSPDYProxyServerConnector@63a4bb{HTTP/1.1}{0.0.0.0:8080}
2013-03-11 22:21:29.864:INFO:oejssp.HTTPSPDYProxyServerConnector:main: Started HTTPSPDYProxyServerConnector@b0a583{SSL-npn}{0.0.0.0:8443}
2013-03-11 22:21:47.162:WARN:oejut.QueuedThreadPool:qtp16655481-26: 
java.lang.NoSuchMethodError: sun.security.ssl.EngineInputRecord.decrypt(Lsun/security/ssl/CipherBox;Ljava/nio/ByteBuffer;)Ljava/nio/ByteBuffer;
at sun.security.ssl.SSLEngineImpl.readRecord(SSLEngineImpl.java:957)
at sun.security.ssl.SSLEngineImpl.readNetRecord(SSLEngineImpl.java:888)
at sun.security.ssl.SSLEngineImpl.unwrap(SSLEngineImpl.java:762)
at javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:624)
at org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.fill(SslConnection.java:487)
at org.eclipse.jetty.spdy.server.NextProtoNegoServerConnection.fill(NextProtoNegoServerConnection.java:100)
at org.eclipse.jetty.spdy.server.NextProtoNegoServerConnection.onFillable(NextProtoNegoServerConnection.java:68)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.run(AbstractConnection.java:240)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:589)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:520)
at java.lang.Thread.run(Thread.java:722)
2013-03-11 22:21:47.162:WARN:oejut.QueuedThreadPool:qtp16655481-25: 
java.lang.NoSuchMethodError: sun.security.ssl.EngineInputRecord.decrypt(Lsun/security/ssl/CipherBox;Ljava/nio/ByteBuffer;)Ljava/nio/ByteBuffer;
at sun.security.ssl.SSLEngineImpl.readRecord(SSLEngineImpl.java:957)
at sun.security.ssl.SSLEngineImpl.readNetRecord(SSLEngineImpl.java:888)
at sun.security.ssl.SSLEngineImpl.unwrap(SSLEngineImpl.java:762)
at javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:624)
at org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.fill(SslConnection.java:487)
at org.eclipse.jetty.spdy.server.NextProtoNegoServerConnection.fill(NextProtoNegoServerConnection.java:100)
at org.eclipse.jetty.spdy.server.NextProtoNegoServerConnection.onFillable(NextProtoNegoServerConnection.java:68)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.run(AbstractConnection.java:240)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:589)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:520)
at java.lang.Thread.run(Thread.java:722)


No active SPDY session when I look at chrome://net-internals/#events&q=type:SPDY_SESSION%20is:active
 
This is on Ubuntu 12.04
$ java -version
java version "1.7.0_15"
OpenJDK Runtime Environment (IcedTea7 2.3.7) (7u15-2.3.7-0ubuntu1~12.04.1)
OpenJDK Server VM (build 23.7-b01, mixed mode)

Any idea?

Best regards,
Arjan


Date: Mon, 11 Mar 2013 09:44:29 +0100
From: Thomas Becker <tbecker@xxxxxxxxxxx>
To: jetty-users@xxxxxxxxxxx
Subject: Re: [jetty-users] Minimalistic SPDY proxy setup using Jetty
        9.0.0
Message-ID: <513D996D.7060207@xxxxxxxxxxx>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Hi Arjan,

you've seen the example configuration for a SPDY to HTTP proxy in the
documentation?

It's described here:
http://www.eclipse.org/jetty/documentation/current/spdy-configuring-proxy.html#spdy-to-http-example-config

Regarding your steps:

2. I usually put the npn file in $JETTY_HOME, but that's just my
personal preference.
3. Comment out jetty-http.xml to disable the HTTP coonector you don't need.
4. That depends on what you want to achieve. Read the documentation:
http://www.eclipse.org/jetty/documentation/current/spdy-configuring-proxy.html#spdy-example-config

and try to apply the settings according to your setup.
5. You need to include the npn jar in the classpath like so:
-Xbootclasspath/p:$JETTY_HOME/npn-boot-1.1.2.v20130305.jar
Make sure to change the path to npn-boot if you don't have it in
$JETTY_HOME.

Cheers,
Thomas
Am 3/10/13 10:49 PM, schrieb Arjan Peddemors:
> Hi all,
> I'm kind of lost setting up a simple Jetty SPDY proxy configuration on
> my Ubuntu 12.04 machine with OpenJDK 7. I have read the SPDY
> documentation, but can't seem to get it going.
>
> Say I have a regular (backend) web server running on the same machine,
> listening for incoming HTTP request on port 7070. I want to setup the
> proxy as a frontend such that HTTP over SPDY/3 requests are forwarded to
> localhost:7070. Given the new Jetty 9.0.0 distribution, what would be
> the *concrete* steps to set this up as simple as possible?
>
> I would say these are the steps, but what about step 3 and 4?
> 1- Unpack the distribution; cd into it
> 2- Download npn-boot-1.1.2.v20130305.jar from repo1.maven.org
> <http://repo1.maven.org>, and copy to the lib directory
> 3- Change the start.ini file: exactly what changes for a minimalistic setup?
> 4- Change the etc/jetty-spdy-proxy.xml file: exactly what changes?
> Self-signed certificate is ok.
> 5- Run it with: java -jar start.jar
>
> Thx,
> Arjan
>
>
>
> _______________________________________________
> jetty-users mailing list
> jetty-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/jetty-users
>


Back to the top