ソケット

マニフェスト プロパティ sockets は、sockets.udpsockets.tcpsockets.tcpServer API で使用可能な権限を宣言します。

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

リファレンス

  • udp(オブジェクト) - 省略可

    udp マニフェスト プロパティは、アプリが発行できる sockets.udp オペレーションを宣言します。

    タイプ属性説明
    文字列または文字列の配列(省略可)バインディング

    bind オペレーションの host:port パターン。

    文字列または文字列の配列(省略可)送信

    send オペレーションの host:port パターン。

    文字列または文字列の配列(省略可)multicastMembership

    joinGroup オペレーションの host:port パターン。

  • tcp(オブジェクト) - 省略可

    tcp マニフェスト プロパティは、アプリが発行できる sockets.tcp オペレーションを宣言します。

    タイプ属性説明
    文字列または文字列の配列(省略可)接続

    connect オペレーションの host:port パターン。

  • tcpServer(オブジェクト) - 省略可

    tcpServer マニフェスト プロパティは、アプリが発行できる sockets.tcpServer オペレーションを宣言します。

    タイプ属性説明
    文字列または文字列の配列(省略可)listen

    listen オペレーションの host:port パターン。