Mixin Network的Token debug方法

首先,在服务器端,用nc -l 7000,开一个tcp 侦听在7000端口,

nc -l 7000

在客户端,将原来的wss修改成ws,比如wss://blaze.mixin.one修改成ws://blaze.mixin.one:7000,

这里将wss修改成ws,即https改成http,7000是指定端口!

        ws = websocket.WebSocketApp("ws://blaze.mixin.one:7000",
                on_message = on_message,
                on_error = on_error,
                on_close = on_close,
                header = ["Authorization:Bearer " + encoded],
                subprotocols = ["Mixin-Blaze-1"],
                on_data = on_data)
        ws.on_open = on_open

mixin_client连接上来后,数据如下:

wenewzha:ocean.one wenewzhang$ nc -l 7000
GET / HTTP/1.1
Upgrade: websocket
Connection: Upgrade
Host: blaze.mixin.one:7000
Origin: http://blaze.mixin.one:7000
Sec-WebSocket-Key: j60i7568zjZ1AljVA4ekFw==
Sec-WebSocket-Version: 13
Sec-WebSocket-Protocol: Mixin-Blaze-1
Authorization:Bearer eyJhbGciOiJSUzUxMiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIzYmFjZDZkZi1jZWIwLTQ4NTgtYTc2MS0zYzE1MzViMzM3ZjIiLCJ1aWQiOiIyMTA0MjUxOC04NWM3LTQ5MDMtYmIxOS1mMzExODEzZDFmNTEiLCJzaWciOiJmODM3ZWJlYjRjMjk4MWFkOWM2NGI3MGQwYjBkMTg3MjRjNzZjNjA3ODFiOWU0YmY3YTU4MjUxMGRmN2FkYTM5IiwiZXhwIjoxNTQ0MjQzNDE0LCJzaWQiOiI0YzZiZGExMS0zNDYwLTRiYzktOTY3My05OTZhYzM0Yjc5MDciLCJpYXQiOjE1NDQxNDM0MTR9.fo0pOeoQRM3SmvomA4m72kMr4_GybJ9ilT4Ml2M-bKi2Sf4KvWF9xzinHtVRDl2GFx_YvOXNpQUVEFyLyv68ses4a_e1SlRXDv2pqm6x_broMUpNKd2jVpTgpQvschbhXQzbYGgP2Bg_PeLtp6Ck6F1HdTqZhO4npFs-Pr_YOsA

差点忘记了,还修改了hosts
 

sudo vi /etc/hosts
127.0.0.1  blaze.mixin.one

 

添加新评论

Restricted HTML

  • 允许的HTML标签:<a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • 自动断行和分段。
  • 网页和电子邮件地址自动转换为链接。