ソケット

sockets マニフェスト プロパティは、sockets.udp で使用できる権限を宣言します。 sockets.tcp API と sockets.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 オペレーションの host:port のパターン。