title: Connect to URL using java socket
body: <p>I have a STOMP websocket server accepting connections on localhost:8080/price-stream/ws</p>
  
  <p>I am attempting to connect using the <a href="https://github.com/pedroteixeira/gozirra" rel="nofollow">Gozirra library</a> which uses java.net.socket to connect, but the new Socket() method only accepts host and port parameters. Connection code <a href="https://github.com/pedroteixeira/gozirra/blob/master/src/main/java/net/ser1/stomp/Client.java#L48" rel="nofollow">here</a> . Is there a way to define the full resource location in the socket parameters, to include the price-stream/ws location? </p>
  
  <pre><code>Client c;
      try {
          c = new Client("localhost", 8080, "guest", "guest");
          c.subscribe("topic/pricechannel1", new Listener() {
  
              @Override
              public void message(Map headers, String body) {
  
                  System.out.println(body);
              }
  
          });
          c.unsubscribe("topic/pricechannel1"); // Unsubscribe all listeners
          c.disconnect();
      } catch (LoginException | IOException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      }
  </code></pre>
  
  <p>Failing that, is there a way on the server-side I could forward a request for a Spring websocket connection? In other words, my server is a Spring webapp running on tomcat. Is there a way I could forward requests to the root of my server i.e. localhost:8080 in this case, into a specified resource location in tomcat. I am not very well versed in linux server configuration but I assume it is possible with some tweaking. Thanks</p>