docker-console
docker-console copied to clipboard
in the terminal curl and vim command can not return anything
in the terminal curl and vim command can not return anything
curl 是没问题,vim的确是有问题。
原因 main.js:45 WebSocket connection to 'ws://xxxx:5000/echo' failed: Could not decode a text frame as UTF-8.
后来测试发现是python2 对utf-8处理问题。换py3,但无法运行。暂时搁置。找机会用django实现吧。
curl肯定是没问题的,vim 及 vi输入中文字符的时候会出现问题,主要是因为xterm.js这个框架对编码格式的支持还不太完善,或是我还不太熟悉这个框架,这个问题我会尽量修复
之前折腾了几天,发现的确是字符集问题,然后很难排查。我想py3应该没问题的,不过gevent好像对py3不怎么友好。这是个好项目, @lanbiter 希望可以解决。
lz,不知道有没有搞定这个问题啊,这个不能vim真的很烦人啊。我看了一下你的index.html有引用app.js,但是你项目里没有这个文件,不知道是不是这个问题
resp = self.sock.recv(10240000) 把这个值调大一些就可以用vim了,因为vim时文件内容太多被截断了
另外有无可能迁移到python3
试了一下,修改了thread_Send.py中的代码,还是不行啊,依然不能用。cz,你是拿的这个lz的代码么?
我就是改了这里,就能vim打开很多大的文件了,包含中文字符的文件没尝试过
我就是vim一个新的文件,然后进程就死掉了。。。,一脸懵逼啊。。。用的是py2。
如果你也是在学习这个框架,在做demo,能不能借我看看你这个代码(如果可以的话)多谢了。这个东西困扰我好久了
def run(self):
while not self.ws.closed:
try:
resp = self.sock.recv(10240000)
if resp is not None and len(resp) is not 0:
self.ws.send(resp)
else:
print 'Connection disconnected...'
self.ws.send('Connection disconnected...')
self.ws.close()
self.sock.close()
except:
print 'Connection exception...'
self.ws.send('Connection exception...')
self.ws.close()
self.sock.close()
break
大神啊。。还是不行,还是在vim那里卡在那里。。有没有其他方法解决啊。
WebSocket connection to 'ws://192.168.3.199:5000//echo' failed: Could not decode a text frame as UTF-8. 。他是这个问题
问下你们都能用吗?