I am trying to create a tcp socket in the background script of my app.
The error is (first line in 1.js):
Uncaught TypeError: Cannot read property 'tcp' of undefined
Background script 1.js:
chrome.sockets.tcp.create({}, function(createInfo) {
chrome.sockets.tcp.connect(createInfo.socketId,
"127.0.0.1", 4005, function(socketInfo) {
});
});
Manifest file :
{
"manifest_version": 2,
"name": "UDP TEST",
"version": "1.0",
"app": {
"background": {
"scripts": ["1.js"]
}
},
"permissions": [
{
"socket": [
"tcp-listen:*:*",
"tcp-connect",
"resolve-host"
]
}
]
}
Can anyone help me? Thanks!
We need chrome extensions to support UDP/TCP sockets. I can't migrate chrome.sockets to extensions dammit. Native messaging is not a real solution to chrome.sockets. Does it even make sense that I would have to create a Windows native app just to receive "UDP and TCP messages" from Chrome extension via Chrome's native message and then pass on those requests to the actual UDP and TCP? The performance hit is Huge (which would defeat the whole purpose of UDP and TCP in the first place)!" and hit submit suggestion.