Hi,

On Thu, Jun 23, 2016 at 4:22 PM, Alexander Farber
<[email protected]> wrote:
> do I need to add
>
>         ServerConnector sslConnector = new ServerConnector(server,
>             new
> SslConnectionFactory(sslContextFactory,HttpVersion.HTTP_1_1.asString()),
>             new HttpConnectionFactory(https_config));
>
> even if I intend my embedding Jetty program to serve WebSocket connections
> only?

Yes, because WebSocket starts with a normal HTTP request that is then
upgraded to WebSocket, so you need the HTTP part.

> My background is that I am developing a word game and have purchased Thawte
> SSL certificate for 2 domains: "example.com" and "www.example.com".
>
> On example.com ports 80 and 443 Apache+WordPress is running and serves HTML5
> canvas with the game.
>
> On www.example.com (different IP address!) ports 80 and 443 I am trying to
> run embedded Jetty which would answer WebSocket requests.

In general, you don't need that, since Jetty can serve WordPress too
(see http://www.eclipse.org/jetty/documentation/9.3.x/configuring-fastcgi.html).
We suggest HAProxy in front of Jetty:
http://www.eclipse.org/jetty/documentation/9.3.x/http2-configuring-haproxy.html

> If a player would ever manually enter "www.example.com" into her browser, I
> would like Jetty to rewrite the URL to "example.com" and redirect.
>
> So would I need new HttpConnectionFactory(https_config) here?
>
> Or would I have to use the RewriteHandler for that like in
>
> https://github.com/eclipse/jetty.project/blob/jetty-9.3.10.v20160621/examples/embedded/src/main/java/org/eclipse/jetty/embedded/LikeJettyXml.java#L200

You need a rewrite handler to rewrite URLs.
Note that in the example you linked, the RewriteHandler has no rules,
so it does nothing.

If you use HAProxy, then HAProxy can do domain redirection.

-- 
Simone Bordet
----
http://cometd.org
http://webtide.com
Developer advice, training, services and support
from the Jetty & CometD experts.
_______________________________________________
jetty-users mailing list
[email protected]
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users

Reply via email to