Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

希望补充插件TCP通信方面的实例 #16

Open
lon91ong opened this issue May 30, 2019 · 0 comments
Open

希望补充插件TCP通信方面的实例 #16

lon91ong opened this issue May 30, 2019 · 0 comments

Comments

@lon91ong
Copy link

lon91ong commented May 30, 2019

首先要感谢大侠的教程,诚如其名,干货满满!

想要在我的插件中添加TCP通信功能,找了好多参考(参考一, 参考二, 参考三, 参考四),都是语焉不详
最多见到的例子如下:

chrome.experimental.socket.create('tcp', '127.0.0.1', 8080, function(socketInfo) {
  chrome.experimental.socket.connect(socketInfo.socketId, function (result) {
        chrome.experimental.socket.write(socketInfo.socketId, "Hello, world!");         
    });
});

说是需要保存 socketId 供后面调用,但是 socketId 是怎么来的都没说清楚

希望大侠能通过实例把这部分补充到教程中,多谢了!

补充几个有价值的参考:
参考1
websocket-client
Websocket Server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant