- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我正在使用 localtunnel v1 .但是我发现v2允许你自定义子域,我需要这个功能。
我遵循了 repository 的 README
中描述的教程,但它在几个方面让我感到困惑,最后,它没有用。
第一步是运行一些网络应用程序:选中,端口号。 8000.
然后,它说了一些关于主机名的事情:
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.
example.localtunnel.local -> 127.0.0.1
localtunnel.local -> 127.0.0.1You can do this in /etc/hosts or use that fancy ghost utility.
我在这里迷路了,但我仍然编辑了我的 /etc/hosts
:
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
下一步...
Now you can start the server. It's based on a configuration file in the config directory. You can make your own, but this one is configured to run the server on port 9999 and expects the hostname localtunnel.local
ginkgo config/default.conf.py
哪一个?无论如何...我根据 localtunnel repo 目录 /deploy
中的文件创建了 myconfig.conf.py :
port = 9999
hostname = 'localtunnel.local'
service = 'localtunnel.server.TunnelBroker'
但是,当我运行时:
lt --broker 127.0.0.1:9999 --name example 8000
我得到了:
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'
<Greenlet at 0xb6e0db1cL: <bound method TunnelClient.listen of <localtunnel.client.TunnelClient object at 0xb6def52c>>> failed with TypeError
而在银杏过程中:
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)
<BrokerFrontend fileno=6 address=0.0.0.0:9999>: Failed to handle request:
request = GET /t/example HTTP/1.1 from ('127.0.0.1', 35907)
application = <ws4py.server.wsgi.middleware.WebSocketUpgradeMiddleware object at 0x95bc2ac>
127.0.0.1 - - [2012-05-14 17:18:18] "GET /t/example HTTP/1.1" 101 162 0.000933
而且,显然,http://example.localtunnel.local:9999不起作用。
如何解决这个问题?我必须在哪里修改才能更改最终的子域?
对不起,令人毛骨悚然的英语。
编辑
我已经按照保罗的建议进行了降级。但是,尽管发生了变化,错误仍然存在。银杏工艺:
$ 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
本地隧道进程:
$ lt --broker 127.0.0.1:9999 --name example 8000
Traceback (most recent call last):
File "/usr/local/bin/lt", line 9, in <module>
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
虽然现在 ginkgo 没有报错,但是 localtunnel 还是会报错,和之前的报错不一样。显然它试图在连接过程中获取“/t/example”。
最佳答案
看起来这个软件需要旧版本的 ws4py。 current version (0.2.1) ws4py 匹配它看起来像你有什么,而 0.1.5 version of ws4py匹配 localtunnel 尝试使用的内容。
降级到 ws4py 0.1.5 可能足以解决您遇到的问题。
不过,另一方面,这似乎并不是世界上支持最好的软件。您确定这是解决您问题的正确方法吗?我查看了代码和该 repo 中提供的所有文档,我得到的是它设置了这个奇怪的 tcp-tunnel-over-json-over-websockets(是的,websockets,用于在两者上都使用 python 的东西)服务器端和客户端!)的东西,甚至没有提供任何特定的安全性或加密或它自己的稳健性功能,而且它似乎没有做其他更常见的工具不能做得更好的事情。但当然,我可能会遗漏一些重要的东西。
关于python - 如何正确运行 localtunnel v2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10590506/
我一直在使用 localtunnel很长一段时间,现在我想知道它是如何工作的。 Here是我读过的一篇解释相同的文章。 以下是我在上面的文章中不理解的几个术语: the localtunnel ser
我正在使用 Node js 作为服务器。使用 localtunnel 时是否必须配置 index.js 文件?提交表单时,我必须指定哪个 URL?我应该使用 localtunnel 提供的 URL 吗
我正在使用 localtunnel v1 .但是我发现v2允许你自定义子域,我需要这个功能。 我遵循了 repository 的 README 中描述的教程,但它在几个方面让我感到困惑,最后,它没有用
我尝试使用以下命令运行localtunnel: localtunnel 3000 并得到此错误: [Error] Unable to register tunnel. Perhaps service
我有一个网站,该网站跨到本地服务器,一个用于前端,位于 localhost:3000,另一个用于位于 localhost:3001 的restapi 我想使用 localtunnel 或 ngrok
已关闭。此问题旨在寻求有关书籍、工具、软件库等的建议。不符合Stack Overflow guidelines .它目前不接受答案。 我们不允许提问寻求书籍、工具、软件库等的推荐。您可以编辑问题,以
我正在使用 localtunnel 公开我的后端和前端。现在,我有一个像这样的非常简单的设置: const httpServer = require('http').createServer(); c
服务如 ngrok和 localtunnel存在这样你就可以(我不太热衷于描述这一点)将你的本地主机放在公共(public)网络上以访问公共(public) URL。 Localtunnel显得更受欢
我正在尝试在Ubuntu上设置localtunnel,但我不断收到错误消息: your url is: undefined /usr/local/lib/node_modules/localtunne
按照 http://progrium.com/localtunnel/ 的说明和其他地方: gem install localtunnel localtunnel -k ~/.ssh/id_rsa.p
我正在使用 localtunnel.me ( https://github.com/localtunnel/localtunnel ) 创建到我的本地主机的连接。我在终端使用以下命令: lt --po
我想了解如何将我的本地 IP 地址 (localhost) 暴露给 Internet。为此,我已阅读 [here]一种使用 SSH 进行端口转发的方法。这基本上是使用 SSH 从公开可用的服务器路由到
我想使用ngrok在端口 4000 上,这是一个将导出 Forwarding 的命令网址。每次运行时都会有一个新的随机生成的 URL。 我想传递该网址 http://2e1v870f.ngrok.io
我正在尝试在Ubuntu上设置本地隧道,但我一直收到错误:。我正在使用Xampp。这可能是什么问题呢?。谢谢大家。
我是一名优秀的程序员,十分优秀!