prises

La propriété de fichier manifeste sockets déclare les autorisations disponibles pour les API sockets.udp, sockets.tcp et sockets.tcpServer.

Exemple de fichier 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"
   
}
 
},
 
...
}

Référence

  • udp (objet) : facultatif

    La propriété du fichier manifeste udp déclare les opérations sockets.udp qu'une application peut émettre.

    TypeAttributDescription
    chaîne ou tableau de chaînes(facultatif) liaison

    Modèle host:port pour les opérations bind.

    chaîne ou tableau de chaîne(facultatif) envoyer

    Modèle host:port pour les opérations send.

    chaîne ou tableau de chaîne(facultatif) multicastMembership

    Modèle host:port pour les opérations joinGroup.

  • tcp (objet) : facultatif

    La propriété du fichier manifeste tcp déclare les opérations sockets.tcp qu'une application peut émettre.

    TypeAttributDescription
    chaîne ou tableau de chaîne(facultatif) connect

    Modèle hôte:port pour les opérations connect.

  • tcpServer (objet) : facultatif

    La propriété de fichier manifeste tcpServer déclare les opérations sockets.tcpServer qu'une application peut émettre.

    TypeAttributDescription
    chaîne ou tableau de chaînes(facultatif) écouter

    Modèle host:port pour les opérations listen.