title: How to run localtunnel v2 properly
body: <p>I'm using <a href="http://progrium.com/localtunnel/" rel="noreferrer">localtunnel v1</a>. But I found that v2 allows you to customize the subdomain, and I need this feature.</p>
  
  <p>I followed the tutorial described in the <code>README</code> from the <a href="https://github.com/progrium/localtunnel" rel="noreferrer">repository</a>, but it confused me in several parts and, in the end, it did not work.</p>
  
  <p>First step is to run some web-app: checked, on port no. 8000.</p>
  
  <p>Then, it says something about hostnames:</p>
  
  <blockquote>
    <p>Localtunnel does some stuff with the hostname, so you want to set up two
    hostnames. One for localtunnel registration, one for your localtunnel.
    Normally it expects a wildcard, but we'll just hardcode a hostname for
    this example tunnel.</p>
    
    <p>example.localtunnel.local -> 127.0.0.1<br>
    localtunnel.local -> 127.0.0.1</p>
    
    <p>You can do this in /etc/hosts or use that fancy ghost utility.</p>
  </blockquote>
  
  <p>I've got lost here, but still I edited my <code>/etc/hosts</code>:</p>
  
  <pre><code>127.0.0.1   localhost
  127.0.1.1   my-pc-name
  127.0.0.1   example.localtunnel.local
  127.0.0.1   localtunnel.local
  </code></pre>
  
  <p>Next step...</p>
  
  <blockquote>
    <p>Now you can start the server. It's based on a configuration file in the
    config directory. You can make your own, but <strong>this one</strong> is configured to
    run the server on port 9999 and expects the hostname localtunnel.local</p>
    
    <p>ginkgo config/default.conf.py</p>
  </blockquote>
  
  <p>Which one? Anyway... I created myconfig.conf.py based on the files in localtunnel repo's dir  <a href="https://github.com/progrium/localtunnel/tree/master/deploy" rel="noreferrer"><code>/deploy</code></a>:</p>
  
  <pre><code>port = 9999
  hostname = 'localtunnel.local'
  service = 'localtunnel.server.TunnelBroker'
  </code></pre>
  
  <p>But, when I run:</p>
  
  <pre><code>lt --broker 127.0.0.1:9999 --name example 8000
  </code></pre>
  
  <p>I got:</p>
  
  <pre><code>Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/gevent/greenlet.py", line 390, in run
    result = self._run(*self.args, **self.kwargs)
  File "/usr/local/lib/python2.7/dist-packages/localtunnel/client.py", line 53, in listen
    msg = self.ws.receive(msg_obj=True)
  TypeError: receive() got an unexpected keyword argument 'msg_obj'
  &lt;Greenlet at 0xb6e0db1cL: &lt;bound method TunnelClient.listen of &lt;localtunnel.client.TunnelClient object at 0xb6def52c&gt;&gt;&gt; failed with TypeError
  </code></pre>
  
  <p>And in the ginkgo process:</p>
  
  <pre><code>Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/gevent/pywsgi.py", line 438, in handle_one_response
    self.run_application()
  File "/usr/local/lib/python2.7/dist-packages/ws4py/server/geventserver.py", line 85, in run_application
    self.result = self.application(self.environ, start_response_for_upgrade)
  File "/usr/local/lib/python2.7/dist-packages/ws4py/server/wsgi/middleware.py", line 131, in __call__
    environ.copy()))
  TypeError: handle_websocket() takes exactly 3 arguments (2 given)
  &lt;BrokerFrontend fileno=6 address=0.0.0.0:9999&gt;: Failed to handle request:
    request = GET /t/example HTTP/1.1 from ('127.0.0.1', 35907)
    application = &lt;ws4py.server.wsgi.middleware.WebSocketUpgradeMiddleware object at 0x95bc2ac&gt;
  
  127.0.0.1 - - [2012-05-14 17:18:18] "GET /t/example HTTP/1.1" 101 162 0.000933
  </code></pre>
  
  <p>And, obviously, <a href="http://example.localtunnel.local:9999" rel="noreferrer">http://example.localtunnel.local:9999</a> does not work.</p>
  
  <p>How to fix this? And where I have to modify to change the final subdomain?</p>
  
  <p>Sorry about the creepy english.</p>
  
  <hr>
  
  <p><strong>Edit</strong></p>
  
  <p>I've followed <em>the paul</em> suggestion and did the downgrading. But although changes have happened, errors still occur. ginkgo process:</p>
  
  <pre><code>$ ginkgo eco.conf.py  
  Starting process with eco.conf.py...  
  127.0.0.1 - - [2012-05-22 20:21:11] "GET /t/example HTTP/1.1" 400 116 0.000190
  </code></pre>
  
  <p>localtunnel process:</p>
  
  <pre><code>$ lt --broker 127.0.0.1:9999 --name example 8000
  Traceback (most recent call last):
    File "/usr/local/bin/lt", line 9, in &lt;module&gt;
      load_entry_point('localtunnel==0.4.0', 'console_scripts', 'lt')()
    File "/usr/local/lib/python2.7/dist-packages/localtunnel/client.py", line 31, in main
      client.serve_forever()
    File "/usr/local/lib/python2.7/dist-packages/ginkgo/core.py", line 188, in serve_forever
      self.start()
    File "/usr/local/lib/python2.7/dist-packages/ginkgo/core.py", line 124, in start
      ready = not self.do_start()
    File "/usr/local/lib/python2.7/dist-packages/localtunnel/client.py", line 42, in do_start  
      self.ws.connect()
    File "/usr/local/lib/python2.7/dist-packages/ws4py-0.1.5-py2.7.egg/ws4py/client/threadedclient.py", line 72, in connect
      self.process_response_line(response_line)
    File "/usr/local/lib/python2.7/dist-packages/ws4py-0.1.5-py2.7.egg/ws4py/client/__init__.py", line 61, in process_response_line
      raise HandshakeError("Invalid response status: %s %s" % (code, status))
  ws4py.exc.HandshakeError: Invalid response status: 400 Bad Handshake
  </code></pre>
  
  <p>Although ginkgo does not give any error now, localtunnel still raising errors different from previous errors. Apparently it tries to GET "/t/example" in the connecting process.</p>