Package ratpack.server

Examples of ratpack.server.PublicAddress


import static ratpack.util.ExceptionUtils.uncheck;

public class WebSocketEngine {

  public static <T> void connect(final Context context, String path, int maxLength, final WebSocketHandler<T> handler) {
    PublicAddress publicAddress = context.get(PublicAddress.class);
    URI address = publicAddress.getAddress(context);
    URI httpPath = address.resolve(path);

    URI wsPath;
    try {
      wsPath = new URI("ws", httpPath.getUserInfo(), httpPath.getHost(), httpPath.getPort(), httpPath.getPath(), httpPath.getQuery(), httpPath.getFragment());
View Full Code Here


    //Rules
    //1. Given absolute URL use it
    //2. Given Starting Slash prepend public facing domain:port if provided if not use base URL of request
    //3. Given relative URL prepend public facing domain:port plus parent path of request URL otherwise full parent path

    PublicAddress publicAddress = context.get(PublicAddress.class);
    String generatedPath;
    URI host = publicAddress.getAddress(context);

    if (ABSOLUTE_PATTERN.matcher(path).matches()) {
      //Rule 1 - Path is absolute
      generatedPath = path;
    } else {
View Full Code Here

TOP

Related Classes of ratpack.server.PublicAddress

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.