This page is part of the documentation for the Chrome Apps platform, which was deprecated in 2020. Chrome Apps in Kiosk Mode used by Enterprise and Education customers will no longer be supported after April 2027, marking their end of life. Additionally, all remaining Chrome Apps used in managed environments by Enterprise and Education organizations will reach their end of life in October 2028. Learn more about migrating your app.

sockets

The sockets manifest property declares which permissions are available for the sockets.udp, sockets.tcp and sockets.tcpServer APIs.

Sample manifest.json

{
"name":"My Sockets app",
"sockets":{
"udp":{
// Permission for chrome.sockets.udp.send:
// The application is allowed to send udp packets
// to any host:port combination.
"send":"*"
},
"tcp":{
// Permission for chrome.sockets.tcp.connect:
// The application is allowed to connect only to the
// tcp server on 127.0.0.1 port 80.
"connect":"127.0.0.1:80"
},
"tcpServer":{
// Permission for chrome.sockets.tcpServer.listen:
// The application is allowed to accept new client
// connections on the local address at port 80.
"listen":"127.0.0.1:80"
}
},
...
}

Reference

  • udp (object) - optional

    The udp manifest property declares which sockets.udp operations an app can issue.

    TypeAttributeDescription
    string or array of string(optional) bind

    The host:port pattern for bind operations.

    string or array of string(optional) send

    The host:port pattern for send operations.

    string or array of string(optional) multicastMembership

    The host:port pattern for joinGroup operations.

  • tcp (object) - optional

    The tcp manifest property declares which sockets.tcp operations an app can issue.

    TypeAttributeDescription
    string or array of string(optional) connect

    The host:port pattern for connect operations.

  • tcpServer (object) - optional

    The tcpServer manifest property declares which sockets.tcpServer operations an app can issue.

    TypeAttributeDescription
    string or array of string(optional) listen

    The host:port pattern for listen operations.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2014年01月08日 UTC.