ソケット

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

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

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

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

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

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

    種類属性説明
    文字列または文字列の配列(省略可)連絡

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

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

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

    種類属性説明
    文字列または文字列の配列(任意)聴く

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