Reputation: 6259
I tried to start a simple tcp-server:
chrome.sockets.tcpServer.create({}, function(info){
chrome.sockets.tcpServer.listen(info.socketId, 'localhost', 2000, function(result){
console.log(result);
});
});
But somehow console.log(result);
always prints out undefined
!
http://developer.chrome.com/apps/sockets_tcpServer#method-create
http://developer.chrome.com/apps/sockets_tcpServer#method-listen
What do i wrong? Thanks!
Upvotes: 5
Views: 2698
Reputation: 1269
You have to add the following permission to your manifest :
"sockets": {
"tcpServer" : {
"listen": ["host-pattern1", ...],
...
}
}
https://developer.chrome.com/apps/app_network
Upvotes: 1