public PortForwardResult forward(String namespace, String name, List<Integer> ports)
      throws ApiException, IOException {
    String path = makePath(namespace, name);
    WebSocketStreamHandler handler = new WebSocketStreamHandler();
    PortForwardResult result = new PortForwardResult(handler, ports);
    List<Pair> queryParams = new ArrayList<>();
    for (Integer port : ports) {
      queryParams.add(new Pair("ports", port.toString()));
    }
    WebSockets.stream(path, "GET", queryParams, apiClient, handler);

    // Wait for streams to start.
    result.init();

    return result;
  }
public PortForwardResult forward ( String namespace , String name , List < Integer > ports ) throws ApiException , IOException { String path = makePath ( namespace , name ) ; WebSocketStreamHandler handler = new WebSocketStreamHandler ( ) ; PortForwardResult result = new PortForwardResult ( handler , ports ) ; List < Pair > queryParams = new ArrayList < > ( ) ; for ( Integer port : ports ) { queryParams . add ( new Pair ( "ports" , port . toString ( ) ) ) ; } WebSockets . stream ( path , "GET" , queryParams , apiClient , handler ) ; result . init ( ) ; return result ; }
PortForward to a container.

@param namespace The namespace of the Pod
@param name The name of the Pod
@param ports The ports to forward
@return The result of the Port Forward request.