{"id":2342,"date":"2018-04-20T10:40:46","date_gmt":"2018-04-20T01:40:46","guid":{"rendered":"https:\/\/pasero.net\/~mako\/blog\/?p=2342"},"modified":"2018-12-09T16:48:39","modified_gmt":"2018-12-09T07:48:39","slug":"%e3%81%82%e3%82%89%e3%81%9f%e3%82%81%e3%81%a6%e3%83%81%e3%83%a3%e3%83%83%e3%83%88%e3%82%b5%e3%83%9d%e3%83%bc%e3%83%88%e3%82%92%e6%a7%8b%e7%af%89%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/pasero.net\/~mako\/blog\/s\/2342","title":{"rendered":"\u3042\u3089\u305f\u3081\u3066\u30c1\u30e3\u30c3\u30c8\u30b5\u30dd\u30fc\u30c8\u3092\u69cb\u7bc9\u3059\u308b"},"content":{"rendered":"<p><a href=\"https:\/\/conversejs.org\/\" >Converse.js<\/a> \u3068\u3044\u3046 XMPP \u306e Web \u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u3092\u898b\u3064\u3051\u3066\u300c<a href=\"https:\/\/pasero.net\/~mako\/blog\/s\/563\" >\u30c1\u30e3\u30c3\u30c8\u30b5\u30dd\u30fc\u30c8\u3092\u69cb\u7bc9\u3059\u308b<\/a>\u300d\u306e\u8a18\u4e8b\u3092\u66f8\u3044\u305f\u306e\u306f2014\u5e74\u521d\u982d\u3067\u3057\u305f\u3002Converse.js \u304c\u516c\u958b\u3055\u308c\u30661\u5e74\u3081\u307b\u3069\u3067\u30d0\u30fc\u30b8\u30e7\u30f3\u306f 0.7.2 \u3067\u3057\u305f\u3002<\/p>\r\n<p>2018\u5e744\u6708\u73fe\u5728\u306e Converse.js \u306f 3.3.4 \u3067\u3001\u304b\u306a\u308a\u9032\u6b69\u3057\u3066\u3044\u307e\u3059\u3002\u60c5\u5831\u3082\u3042\u3061\u3053\u3061\u306b\u51fa\u3066\u304d\u3066\u3001\u4ee5\u524d\u306f\u82e6\u52b4\u3057\u305f\u3053\u3068\u3082\u73fe\u5728\u3067\u306f\u7c21\u5358\u306b\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3057\u305f\u3002\u672c\u5bb6\u30da\u30fc\u30b8\u4ee5\u5916\u306b\u60c5\u5831\u304c\u6563\u3089\u3070\u3063\u3066\u3044\u307e\u3057\u305f\u306e\u3067\u3053\u3053\u306b\u307e\u3068\u3081\u3066\u306a\u304c\u3089\u3001\u3042\u3089\u305f\u3081\u3066\u30c1\u30e3\u30c3\u30c8\u30b5\u30dd\u30fc\u30c8\u3092\u8a2d\u7f6e\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\r\n<h3>PreBind<\/h3>\r\n<p>\u305d\u306e\u524d\u306b\u3001\u4eca\u56de\u306e\u69cb\u7bc9\u306b\u306f\u7528\u3044\u307e\u305b\u3093\u304c\u3001\u4ee5\u524d\u306f\u79c1\u304c\u3088\u304f\u7406\u89e3\u3067\u304d\u3066\u304a\u3089\u305a\u9069\u5f53\u306b\u8aa4\u9b54\u5316\u3057\u3066\u3044\u305f <a href=\"https:\/\/conversejs.org\/docs\/html\/setup.html#option-1-server-side-authentication-via-bosh-prebinding\" >PreBind<\/a> \u306b\u3064\u3044\u3066\u3001\u7c21\u6f54\u306b\u89e3\u8aac\u3057\u305f\u30da\u30fc\u30b8 <a href=\"https:\/\/chatme.im\/dev\/sviluppatori-jabber\/linguaggio-php\/prebind-connettersi-senza-password\/\" >PreBind: connettersi senza password<\/a> \u304c\u3042\u308a\u307e\u3057\u305f\u306e\u3067\u3001\u7d39\u4ecb\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\r\n<p>PHP \u306e\u30af\u30e9\u30b9 <a href=\"https:\/\/github.com\/candy-chat\/xmpp-prebind-php\">XMPP Prebind for PHP<\/a> \u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u304a\u304d\u3001\u6b21\u306e\u3088\u3046\u306b\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5316\u3057\u307e\u3059\u3002<\/p>\r\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n&lt;?php \r\ninclude 'xmpp-prebind-php\/lib\/XmppPrebind.php';\r\n\r\n$boshUrl = 'https:\/\/example.com:5280\/bosh\/';  \/\/ \u74b0\u5883\u306b\u5408\u308f\u305b\u3066\u5909\u66f4\r\n$server = 'example.com';           \/\/ \u74b0\u5883\u306b\u5408\u308f\u305b\u3066\u5909\u66f4\r\n$username = 'your_username';   \/\/ \u74b0\u5883\u306b\u5408\u308f\u305b\u3066\u5909\u66f4\r\n$password = 'your_password';   \/\/ \u74b0\u5883\u306b\u5408\u308f\u305b\u3066\u5909\u66f4\r\n$resource = rand(10000,99999); \/\/ \u3053\u3053\u3067\u306f5\u6841\u306e\u6570\u5b57\u3002\u74b0\u5883\u306b\u5408\u308f\u305b\u3066\u5909\u66f4\r\n\r\n$xmppPrebind = new XmppPrebind($server, $boshUrl, $resource, false, false);\r\n$xmppPrebind-&gt;connect($username, $password);\r\n$xmppPrebind-&gt;auth();\r\n$sessionInfo = $xmppPrebind-&gt;getSessionInfo(); \/\/ array containing sid, rid and jid\r\n\r\nheader('Content-Type: application\/json');\r\necho json_encode($sessionInfo);\r\n\r\n?&gt;\r\n<\/pre>\r\n<p>\u3053\u308c\u3060\u3051\u3067\u52d5\u304b\u3057\u3066\u307f\u308b\u3068\u5206\u304b\u308a\u307e\u3059\u304c\u3001<var>sid<\/var>, <var>rid<\/var>, <var>jid<\/var> \u306e3\u3064\u3092 JSON \u5f62\u5f0f\u3067\u8fd4\u3059\u3082\u306e\u3067\u3059\u3002<\/p>\r\n<p>\u6b21\u306b\u3001Converse.js \u306e\u521d\u671f\u5316\u306e\u969b\u306b\u3001\u4e0a\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u540d (<var>prebind.php<\/var> \u3060\u3068\u3057\u307e\u3059) \u3092 <var>prebind_url<\/var> \u3067\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\r\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;?php\r\n  $boshUrl = 'https:\/\/example.com:5280\/bosh\/';  \/\/ \u74b0\u5883\u306b\u5408\u308f\u305b\u3066\u5909\u66f4\r\n  $server = 'example.com';      \/\/ \u74b0\u5883\u306b\u5408\u308f\u305b\u3066\u5909\u66f4\r\n  $username = 'your_username';  \/\/ \u74b0\u5883\u306b\u5408\u308f\u305b\u3066\u5909\u66f4\r\n  $prebindUrl = 'prebind.php';  \/\/ \u4e0a\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u306e URL\r\n?&gt;\r\n&lt;html&gt;\r\n  &lt;head&gt;\r\n    ...\r\n    &lt;link type=&quot;text\/css&quot; rel=&quot;stylesheet&quot; media=&quot;screen&quot; href=&quot;https:\/\/cdn.conversejs.org\/css\/inverse.min.css&quot; \/&gt;\r\n    &lt;script src=&quot;https:\/\/cdn.conversejs.org\/dist\/converse.min.js&quot;&gt;&lt;\/script&gt;\r\n    ...\r\n  &lt;\/head&gt;\r\n  &lt;body&gt;\r\n     ...\r\n    &lt;script&gt;\r\n      converse.initialize({\r\n        i18n: 'ja',\r\n        locales_url: 'https:\/\/cdn.conversejs.org\/locale\/{{{locale}}}\/LC_MESSAGES\/converse.json',\r\n        authentication: 'prebind',\r\n        bosh_service_url: '&lt;?php echo $boshUrl; ?&gt;', \r\n        keepalive: true,\r\n        jid: '&lt;?php echo $username.&quot;@&quot;.$server; ?&gt;',\r\n        prebind_url: '&lt;?php echo $prebindUrl; ?&gt;',\r\n        prebind: true,\r\n        ...\r\n      });\r\n    &lt;\/script&gt;\r\n  &lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\r\n<p>\u3053\u306e HTML \u306f\u8ab0\u306b\u3082\u898b\u3089\u308c\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u304c\u3001\u30d1\u30b9\u30ef\u30fc\u30c9\u306f\u4e8b\u524d\u63a5\u7d9a\u306b\u306e\u307f\u7528\u3044\u3089\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u3053\u3053\u306b\u66f8\u304b\u305a\u306b\u6e08\u3080\u3068\u3044\u3046\u308f\u3051\u3067\u3059\u3002<\/p>\r\n<h3>\u30c1\u30e3\u30c3\u30c8\u30b5\u30dd\u30fc\u30c8\u306e\u69cb\u7bc9<\/h3>\r\n<p>XMPP \u30b5\u30fc\u30d0\u30fc\u3067\u533f\u540d\u63a5\u7d9a\u3092\u5229\u7528\u3067\u304d\u308b\u5834\u5408\u3001Converse.js \u306e\u521d\u671f\u5316\u6642\u306b <code>authentication: 'anonymous'<\/code> \u3068\u3059\u308b\u3053\u3068\u3067\u3001\u5b9f\u306f\u4e0a\u8ff0\u306e PreBind \u306f\u307e\u3063\u305f\u304f\u4f7f\u308f\u305a\u306b\u6e08\u307f\u307e\u3059\u3002<\/p>\r\n<p>\u4ee5\u4e0b\u3001\u3053\u306e\u533f\u540d\u63a5\u7d9a\u3092\u4f7f\u3063\u3066\u30c1\u30e3\u30c3\u30c8\u30b5\u30dd\u30fc\u30c8\u3092\u7d44\u307f\u7acb\u3066\u307e\u3059\u3002<\/p>\r\n<ul>\r\n  <li>\u5ba2\u5074\u306f Converse.js \u3067\u533f\u540d (\u4e00\u6642\u7684\u306a JID \u3092\u4f7f\u3046) \u3068\u3059\u308b\u3002<\/li>\r\n  <li>\u7a93\u53e3\u5074\u306e JID (\u305f\u3068\u3048\u3070 <code>support@example.com<\/code>) \u306f\u5171\u6709\u540d\u7c3f\u3068\u3057\u3066\u533f\u540d\u63a5\u7d9a\u6642\u306b\u4e0e\u3048\u3089\u308c\u308b\u3002<\/li>\r\n  <li>\u5ba2\u5074\u306e Converse.js \u306f\u81ea\u52d5\u7684\u306b\u7a93\u53e3\u5074 JID \u3092\u547c\u3073\u51fa\u3057\u30c1\u30e3\u30c3\u30c8\u7a93\u3092\u958b\u304f\u3002<\/li>\r\n<\/ul>\r\n<p style=\"text-indent: 0em;\">\u3068\u3044\u3046\u6d41\u308c\u3067\u3059\u3002<\/p>\r\n<h3>\u30b5\u30fc\u30d0\u30fc\u5074\u8a2d\u5b9a<\/h3>\r\n<h4>BOSH \u307e\u305f\u306f Websocket<\/h4>\r\n<p>\u524d\u8ff0\u306e PreBind \u3067\u3082\u305d\u3046\u3067\u3057\u305f\u304c\u3001<a href=\"https:\/\/docs.ejabberd.im\/admin\/configuration\/#mod-bosh\" >BOSH<\/a> (\u307e\u305f\u306f <a href=\"https:\/\/docs.ejabberd.im\/admin\/configuration\/#mod-http-ws\" >Websocket<\/a>) \u3092\u5229\u7528\u3057\u307e\u3059\u306e\u3067\u3001XMPP \u30b5\u30fc\u30d0\u30fc\u306b\u4ed8\u5c5e\u306e\u305d\u308c\u3089\u306e\u6a5f\u80fd\u3092\u6709\u52b9\u306b\u3057\u3066\u304a\u304d\u307e\u3059\u3002Ejabberd \u306e\u5834\u5408\u3001<code>ejabberd.yml<\/code> \u306f\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\r\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nlisten:\r\n  ...\r\n  -\r\n    port: 5280\r\n    ip: &quot;::&quot;\r\n    module: ejabberd_http\r\n    request_handlers:\r\n      &quot;\/ws&quot;: ejabberd_http_ws\r\n      &quot;\/bosh&quot;: mod_bosh\r\n    http_bind: true\r\n    register: true\r\n    tls: true\r\n  ...\r\nmodules:\r\n  ...\r\n  mod_bosh: {}\r\n  ...\r\n<\/pre>\r\n<h4>\u533f\u540d\u30b5\u30fc\u30d0\u30fc<\/h4>\r\n<p>\u901a\u5e38\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u304c\u30b5\u30fc\u30d0\u30fc\u306b\u63a5\u7d9a\u3059\u308b\u5834\u5408\u306f\u3001\u4e8b\u524d\u306b\u4f5c\u6210\u3057\u3066\u304a\u3044\u305f <code>user@example.com<\/code> \u3068\u3044\u3046\u5f62\u3092\u3057\u305f JID \u3068\u30d1\u30b9\u30ef\u30fc\u30c9\u304c\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u3002\u533f\u540d\u30b5\u30fc\u30d0\u30fc\u306f\u3001\u305d\u306e\u30b5\u30fc\u30d0\u30fc\u540d\u3060\u3051\u3092\u6307\u5b9a\u3057\u3066\u63a5\u7d9a\u3092\u8a66\u307f\u3001@ \u3088\u308a\u524d\u306e\u30e6\u30fc\u30b6\u30fc\u540d\u3092\u4e71\u6570\u306e\u3088\u3046\u306b\u305d\u306e\u3064\u3069\u751f\u6210\u3057\u3066\u63a5\u7d9a\u3057\u307e\u3059\u3002<\/p>\r\n<p>\u30b5\u30fc\u30d0\u30fc\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3 Ejabberd \u306e\u5834\u5408\u3001<a href=\"https:\/\/docs.ejabberd.im\/admin\/configuration\/#anonymous-login-and-sasl-anonymous\" >ejabberd.yml \u306b\u6b21\u306e\u3088\u3046\u306b\u8a2d\u5b9a<\/a>\u3057\u3066 SASL \u533f\u540d\u30b5\u30fc\u30d0\u30fc (anonymous.example.com \u3068\u3044\u3046\u540d\u524d\u3060\u3068\u3057\u307e\u3059) \u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\r\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nhosts:\r\n  - &quot;example.com&quot;\r\n  - &quot;anonymous.example.com&quot;\r\n  ...\r\nhost_config:\r\n  &quot;anonymous.example.com&quot;:\r\n    auth_method: &#x5B;anonymous]\r\n    anonymous_protocol: sasl_anon\r\n<\/pre>\r\n<p>\u306a\u304a\u4eca\u56de\u306f\u7279\u306b\u95a2\u4fc2\u3042\u308a\u307e\u305b\u3093\u304c\u3001\u533f\u540d\u30b5\u30fc\u30d0\u30fc\u3067\u63a5\u7d9a\u3059\u308b\u30e6\u30fc\u30b6\u30fc\u306b\u3064\u3044\u3066\u306f\u3001\u60aa\u7528\u3092\u9632\u3050\u305f\u3081\u6a29\u9650\u3092\u7d5e\u3063\u3066\u304a\u304f\u306e\u304c\u671b\u307e\u3057\u3044\u3067\u3057\u3087\u3046\u3002\u305f\u3068\u3048\u3070\u3001\u5225\u306e\u30b5\u30fc\u30d0\u30fc\u3068\u306e\u901a\u4fe1\u306e\u7981\u6b62\u3001MUC \u8ac7\u8a71\u5ba4\u3084 PubSub \u30ce\u30fc\u30c9\u306e\u4f5c\u6210\u306e\u7981\u6b62\u3001\u306a\u3069\u3067\u3059\u3002<\/p>\r\n<h4>\u7a93\u53e3\u5074\u306eJID<\/h4>\r\n<p>\u7a93\u53e3\u5074\u306eJID (\u4f8b: <code>support@example.com<\/code>) \u306e\u4f5c\u6210\u306f\u3001\u901a\u5e38\u3069\u304a\u308a\u884c\u3044\u307e\u3059\u3002<\/p>\r\n<h4>\u5171\u6709\u540d\u7c3f (shared roster)<\/h4>\r\n<p>\u533f\u540d\u30b5\u30fc\u30d0\u30fc\u306e\u5834\u5408\u3001\u63a5\u7d9a\u306e\u305f\u3073\u306b\u30a2\u30ab\u30a6\u30f3\u30c8\u304c\u65b0\u305f\u306b\u4e00\u6642\u7684\u306b\u751f\u6210\u3055\u308c\u308b\u305f\u3081\u3001\u305d\u306e JID \u306b\u306f\u76f8\u624b\u5148\u540d\u7c3f\u304c\u3042\u308a\u307e\u305b\u3093\u3002\u305d\u3053\u3067\u3001<a href=\"https:\/\/www.ejabberd.im\/shared-roster-all\/\" >\u5171\u6709\u540d\u7c3f (shared roster)<\/a> \u3068\u3044\u3046\u6a5f\u80fd\u3092\u4f7f\u3046\u3053\u3068\u306b\u3057\u307e\u3059\u3002<\/p>\r\n<p>\u307e\u305a Ejabberd \u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb <code>ejabberd.yml<\/code> \u3067\u3053\u306e\u6a5f\u80fd\u3092\u6709\u52b9\u306b\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\r\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nmodules:\r\n  ...\r\n  mod_shared_roster: {}\r\n  ...\r\n<\/pre>\r\n<p>Ejabberd \u306e\u30a6\u30a7\u30d6\u7ba1\u7406\u753b\u9762\u306e\u300c\u30d0\u30fc\u30c1\u30e3\u30eb\u30db\u30b9\u30c8 -> anonymous.example.com -> \u5171\u6709\u540d\u7c3f\u30b0\u30eb\u30fc\u30d7\u300d\u306e\u753b\u9762\u3067\u3001\u307e\u305a\u3072\u3068\u3064\u306e\u30b0\u30eb\u30fc\u30d7\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u305f\u3068\u3048\u3070<\/p>\r\n<ul>\r\n  <li>\u540d\u524d: support<\/li>\r\n  <li>\u8aac\u660e: \u30b5\u30dd\u30fc\u30c8\u7a93\u53e3<\/li>\r\n  <li>\u30e1\u30f3\u30d0\u30fc: support@example.com<\/li>\r\n  <li>\u8868\u793a\u30b0\u30eb\u30fc\u30d7: (\u7a7a\u6b04)<\/li>\r\n<\/ul>\r\n<p style=\"text-indent: 0em;\">\u306e\u3088\u3046\u306b\u3057\u307e\u3059\u3002\u3053\u3053\u3067 <code>support@example.com<\/code> \u306f\u3001\u7a93\u53e3\u5074 (\u554f\u3044\u5408\u308f\u305b\u3092\u53d7\u3051\u308b\u5074) \u306e JID \u3067\u3059\u3002<\/p>\r\n<p>\u3055\u3089\u306b\u3082\u3046\u3072\u3068\u3064\u30b0\u30eb\u30fc\u30d7\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\r\n<ul>\r\n  <li>\u540d\u524d: all<\/li>\r\n  <li>\u8aac\u660e: \u5168\u30e6\u30fc\u30b6\u30fc<\/li>\r\n  <li>\u30e1\u30f3\u30d0\u30fc: @all@<\/li>\r\n  <li>\u8868\u793a\u30b0\u30eb\u30fc\u30d7: support<\/li>\r\n<\/ul>\r\n<p style=\"text-indent: 0em;\">\u3053\u3053\u3067 <code>@all@<\/code> \u306f\u3001\u300c\u5168\u30e6\u30fc\u30b6\u30fc\u300d\u3092\u610f\u5473\u3057\u307e\u3059\u3002<\/p>\r\n<p>\u3053\u308c\u3067\u3001\u300canonymous.example.com \u306e\u5168\u30e6\u30fc\u30b6\u30fc\u306e\u540d\u7c3f\u306b support \u30b0\u30eb\u30fc\u30d7\u306e\u30e1\u30f3\u30d0\u30fc (\u3053\u3053\u3067\u306f <code>support@example.com<\/code> \u306e\u307f) \u3092\u81ea\u52d5\u7684\u306b\u30bb\u30c3\u30c8\u3059\u308b\u300d\u3053\u3068\u304c\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\r\n<h3>Converse.js \u306e\u8a2d\u5b9a<\/h3>\r\n<p>\u30c1\u30e3\u30c3\u30c8\u30a6\u30a3\u30f3\u30c9\u30a6\u3092\u8a2d\u7f6e\u3059\u308b Web \u30da\u30fc\u30b8\u3067\u3001<a href=\"https:\/\/conversejs.org\/docs\/html\/quickstart.html\" >Converse.js \u3092\u8aad\u307f\u8fbc\u3080<\/a>\u3088\u3046\u306b\u3044\u304f\u3064\u304b\u306e\u884c\u3092\u66f8\u304d\u52a0\u3048\u307e\u3059\u3002Converse.js \u305d\u306e\u3082\u306e\u3092\u540c\u3058\u30b5\u30a4\u30c8\u306b\u7f6e\u3044\u3066\u3082\u3044\u3044\u3067\u3059\u3057\u3001CDN \u304b\u3089\u8aad\u307f\u8fbc\u3080\u3088\u3046\u306b\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\r\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;head&gt;\r\n    ...\r\n    &lt;link type=&quot;text\/css&quot; rel=&quot;stylesheet&quot; media=&quot;screen&quot; href=&quot;https:\/\/cdn.conversejs.org\/css\/converse.min.css&quot; \/&gt;\r\n    &lt;script src=&quot;https:\/\/cdn.conversejs.org\/dist\/converse.min.js&quot;&gt;&lt;\/script&gt;\r\n    ...\r\n&lt;\/head&gt;\r\n<\/pre>\r\n<p>\u305d\u308c\u304b\u3089\u3001\u30d1\u30e9\u30e1\u30fc\u30bf\u3068\u3068\u3082\u306b Converse.js \u3092\u521d\u671f\u5316\u3059\u308b\u3053\u3068\u3067\u3001\u305d\u306e\u30da\u30fc\u30b8\u306b\u30c1\u30e3\u30c3\u30c8\u30a6\u30a3\u30f3\u30c9\u30a6\u3092\u8a2d\u7f6e\u3057\u307e\u3059\u3002\u57fa\u672c\u306f<\/p>\r\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\nconverse.initialize({\r\n        websocket_url: 'wss:\/\/example.com:5280\/ws\/',\r\n        authentication: 'anonymous',\r\n        jid: 'anonymous.example.com',\r\n        auto_login: true,\r\n})\r\n<\/pre>\r\n<p style=\"text-indent: 0em;\">\u3067\u3059\u3002\u3053\u3053\u3067\u306f BOSH \u3067\u306f\u306a\u304f WebSocket \u3092\u4f7f\u3046\u5834\u5408\u3067\u3059\u3002\u533f\u540d\u63a5\u7d9a\u306e\u5834\u5408 <var>jid<\/var> \u306f\u30b5\u30fc\u30d0\u30fc\u540d\u306e\u307f\u306b\u3057\u307e\u3059\u3002\u81ea\u52d5\u30ed\u30b0\u30a4\u30f3\u3067\u30b5\u30fc\u30d0\u30fc\u306b\u63a5\u7d9a\u3059\u308b\u306e\u3067\u3059\u304c\u3001\u3053\u306e\u307e\u307e\u3067\u306f\u76f8\u624b\u5148\u3068\u306e\u30c1\u30e3\u30c3\u30c8\u3092\u958b\u304f\u3068\u3053\u308d\u306f\u3067\u304d\u307e\u305b\u3093\u3002<\/p>\r\n<h3>\u81ea\u52d5\u3067\u76f8\u624b\u5148\u3068\u306e\u30c1\u30e3\u30c3\u30c8\u3092\u958b\u304f<\/h3>\r\n<p>\u3053\u306e\u60c5\u5831\u306f\u672c\u5bb6\u3067\u306f\u306a\u3044\u3068\u3053\u308d\u306b\u3042\u308a\u307e\u3057\u305f\u3002<a href=\"https:\/\/stackoverflow.com\/questions\/47034244\/converse-opening-a-chat-from-api\" >Converse opening a chat from API<\/a> \u306e\u56de\u7b54\u3067 Converse.js \u306e\u4f5c\u8005\u304c<a href=\"https:\/\/jsfiddle.net\/jcbrand\/5juvrL3c\/\" >\u30d7\u30e9\u30b0\u30a4\u30f3<\/a>\u3092\u7d39\u4ecb\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\r\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\nconverse.plugins.add('chatsopen', {\r\n      initialize: function() {\r\n        var _converse = this._converse;\r\n        Promise.all(&#x5B;\r\n            _converse.api.waitUntil('rosterContactsFetched'),\r\n            _converse.api.waitUntil('chatBoxesFetched')\r\n        ]).then(function() {\r\n          _converse.api.chats.open('support@example.com');\r\n        });\r\n      }\r\n    });\r\n<\/pre>\r\n<p>\u521d\u671f\u5316\u6642\u306b\u3053\u308c\u3092\u5229\u7528\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\r\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\nwhitelisted_plugins: &#x5B;'chatsopen'],\r\n<\/pre>\r\n<p>\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u30dc\u30c3\u30af\u30b9\u306f\u5168\u90e8\u96a0\u3057\u3066\u3057\u307e\u3046\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\r\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\nblacklisted_plugins: &#x5B;'converse-controlbox'],\r\n<\/pre>\r\n\r\n<h4>\u307e\u3068\u3081<\/h4>\r\n<p>\u4ee5\u4e0a\u3092\u307e\u3068\u3081\u3066 (\u3064\u3044\u3067\u306b<a href=\"https:\/\/conversejs.org\/docs\/html\/configuration.html\" >\u4ed6\u306e\u30d1\u30e9\u30e1\u30fc\u30bf<\/a>\u3082\u8ffd\u52a0\u3057\u3066)\u3001\u30c1\u30e3\u30c3\u30c8\u30a6\u30a3\u30f3\u30c9\u30a6\u3092\u8a2d\u7f6e\u3059\u308b Web \u30da\u30fc\u30b8\u307e\u308b\u3054\u3068\u306e\u4f8b\u3067\u3059\u3002<\/p>\r\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n    &lt;meta charset=&quot;utf-8&quot;\/&gt;\r\n    &lt;title&gt;\u30c1\u30e3\u30c3\u30c8\u30b5\u30dd\u30fc\u30c8&lt;\/title&gt;\r\n    &lt;link type=&quot;text\/css&quot; rel=&quot;stylesheet&quot; media=&quot;screen&quot; href=&quot;https:\/\/cdn.conversejs.org\/css\/converse.min.css&quot; \/&gt;\r\n    &lt;script src=&quot;https:\/\/cdn.conversejs.org\/dist\/converse.min.js&quot;&gt;&lt;\/script&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n&lt;h1&gt;\u30c1\u30e3\u30c3\u30c8\u30b5\u30dd\u30fc\u30c8\u306e\u30da\u30fc\u30b8&lt;\/h1&gt;\r\n&lt;p&gt;\u53f3\u4e0b\u306e\u7a93\u3067\u8a71\u3057\u304b\u3051\u3066\u304f\u3060\u3055\u3044\u3002&lt;\/p&gt;\r\n&lt;\/body&gt;\r\n&lt;script&gt;\r\n    converse.plugins.add('chatsopen', {\r\n      initialize: function() {\r\n        var _converse = this._converse;\r\n        Promise.all(&#x5B;\r\n            _converse.api.waitUntil('rosterContactsFetched'),\r\n            _converse.api.waitUntil('chatBoxesFetched')\r\n        ]).then(function() {\r\n          _converse.api.chats.open('support@example.com');\r\n        });\r\n      }\r\n    });\r\n\r\n    converse.initialize({\r\n        i18n: 'ja',\r\n        locales_url: 'https:\/\/cdn.conversejs.org\/locale\/{{{locale}}}\/LC_MESSAGES\/converse.json',\r\n        authentication: 'anonymous',\r\n        websocket_url: 'wss:\/\/example.com:5280\/ws\/',\r\n        auto_away: 300,\r\n        auto_reconnect: true,\r\n        keep_alive: true,\r\n        jid: 'anonymous.example.com',\r\n        auto_login: true,\r\n        allow_logout: false,\r\n        allow_contact_removal: false,\r\n        allow_contact_requests: false,\r\n        allow_muc: false,\r\n        allow_otr: false,\r\n        allow_registration: false,\r\n        blacklisted_plugins: &#x5B;\r\n            'converse-bookmarks',\r\n            'converse-controlbox',\r\n            'converse-mam',\r\n            'converse-muc',\r\n            'converse-notification',\r\n            'converse-otr',\r\n            'converse-register'\r\n        ],\r\n        whitelisted_plugins: &#x5B;'chatsopen'],\r\n        forward_messages: false,\r\n        message_carbons: false,\r\n        message_archiving: 'never',\r\n        use_vcards: true,\r\n        view_mode: 'overlayed',\r\n        visible_toolbar_buttons: {\r\n            call: false,\r\n            clear: false,\r\n            emoji: true\r\n        }\r\n    });\r\n&lt;\/script&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\r\n<p>\u5b9f\u969b\u306b\u8a2d\u7f6e\u3057\u3066\u307f\u305f\u306e\u304c\u6b21\u3067\u3059 (\u30b5\u30fc\u30d0\u30fc\u540d\u306a\u3069\u5909\u66f4)\u3002<\/p>\r\n<ul>\r\n  <li><a href=\"https:\/\/pasero.net\/~mako\/chatsupport.html\" >\u30c1\u30e3\u30c3\u30c8\u30b5\u30dd\u30fc\u30c8\u306e\u8a2d\u7f6e\u4f8b<\/a><\/li>\r\n<\/ul>\r\n","protected":false},"excerpt":{"rendered":"Converse.js \u3068\u3044\u3046 XMPP \u306e Web \u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u3092\u898b\u3064\u3051\u3066\u300c\u30c1\u30e3\u30c3\u30c8\u30b5\u30dd\u30fc\u30c8\u3092\u69cb\u7bc9\u3059\u308b\u300d\u306e\u8a18\u4e8b\u3092\u66f8\u3044\u305f\u306e\u306f2014\u5e74\u521d\u982d\u3067\u3057\u305f\u3002Converse.js \u304c\u516c\u958b\u3055\u308c\u30661\u5e74\u3081\u307b\u3069\u3067\u30d0\u30fc\u30b8\u30e7\u30f3\u306f 0.7.2 &hellip; <a class=\"more-link\" href=\"https:\/\/pasero.net\/~mako\/blog\/s\/2342\">\u7d9a\u304d\u3092\u8aad\u3080<span class=\"screen-reader-text\">: \u3042\u3089\u305f\u3081\u3066\u30c1\u30e3\u30c3\u30c8\u30b5\u30dd\u30fc\u30c8\u3092\u69cb\u7bc9\u3059\u308b<\/span> <span class=\"meta-nav\" aria-hidden=\"true\">&rarr;<\/span><\/a>","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"blog: \u3042\u3089\u305f\u3081\u3066\u30c1\u30e3\u30c3\u30c8\u30b5\u30dd\u30fc\u30c8\u3092\u69cb\u7bc9\u3059\u308b","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[67,77],"tags":[42,36,34],"class_list":["post-2342","post","type-post","status-publish","format-standard","hentry","category-xmpp-2","category-internet","tag-jabber","tag-xmpp","tag-internet"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pLxlV-BM","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":555,"url":"https:\/\/pasero.net\/~mako\/blog\/s\/555","url_meta":{"origin":2342,"position":0},"title":"\u30c1\u30e3\u30c3\u30c8\u30b5\u30dd\u30fc\u30c8\u3092\u69cb\u7bc9\u3059\u308b (\u305d\u306e1)","author":"Mako","date":"2014\u5e741\u670816\u65e5(\u6728)","format":false,"excerpt":"\u30102018\u5e744\u670820\u65e5\u8ffd\u8a18\u3011\u3053\u306e\u8a18\u4e8b\u306f\u5185\u5bb9\u304c\u53e4\u304f\u306a\u3063\u3066\u3044\u308b\u90e8\u5206\u304c\u3042\u308a\u307e\u3059\u3002\u300c\u3042\u3089\u305f\u3081\u3066\u30c1\u30e3\u30c3\u30c8\u30b5\u30dd\u30fc\u2026","rel":"","context":"Jabber\/XMPP","block_context":{"text":"Jabber\/XMPP","link":"https:\/\/pasero.net\/~mako\/blog\/s\/category\/xmpp-2"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":561,"url":"https:\/\/pasero.net\/~mako\/blog\/s\/561","url_meta":{"origin":2342,"position":1},"title":"\u30c1\u30e3\u30c3\u30c8\u30b5\u30dd\u30fc\u30c8\u3092\u69cb\u7bc9\u3059\u308b (\u305d\u306e3) Converse.js \u3092 WordPress \u3067\u4f7f\u3046\u30d7\u30e9\u30b0\u30a4\u30f3 ConverseJS for WordPress","author":"Mako","date":"2014\u5e741\u670823\u65e5(\u6728)","format":false,"excerpt":"\u30102018\u5e744\u670820\u65e5\u8ffd\u8a18\u3011\u3053\u306e\u8a18\u4e8b\u306f\u5185\u5bb9\u304c\u53e4\u304f\u306a\u3063\u3066\u3044\u308b\u90e8\u5206\u304c\u3042\u308a\u307e\u3059\u3002\u300c\u3042\u3089\u305f\u3081\u3066\u30c1\u30e3\u30c3\u30c8\u30b5\u30dd\u30fc\u2026","rel":"","context":"Jabber\/XMPP","block_context":{"text":"Jabber\/XMPP","link":"https:\/\/pasero.net\/~mako\/blog\/s\/category\/xmpp-2"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":558,"url":"https:\/\/pasero.net\/~mako\/blog\/s\/558","url_meta":{"origin":2342,"position":2},"title":"\u30c1\u30e3\u30c3\u30c8\u30b5\u30dd\u30fc\u30c8\u3092\u69cb\u7bc9\u3059\u308b (\u305d\u306e2) \u30b5\u30fc\u30d0\u30fc ejabberd \u306e\u6e96\u5099","author":"Mako","date":"2014\u5e741\u670820\u65e5(\u6708)","format":false,"excerpt":"\u30102018\u5e744\u670820\u65e5\u8ffd\u8a18\u3011\u3053\u306e\u8a18\u4e8b\u306f\u5185\u5bb9\u304c\u53e4\u304f\u306a\u3063\u3066\u3044\u308b\u90e8\u5206\u304c\u3042\u308a\u307e\u3059\u3002\u300c\u3042\u3089\u305f\u3081\u3066\u30c1\u30e3\u30c3\u30c8\u30b5\u30dd\u30fc\u2026","rel":"","context":"Jabber\/XMPP","block_context":{"text":"Jabber\/XMPP","link":"https:\/\/pasero.net\/~mako\/blog\/s\/category\/xmpp-2"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":563,"url":"https:\/\/pasero.net\/~mako\/blog\/s\/563","url_meta":{"origin":2342,"position":3},"title":"\u30c1\u30e3\u30c3\u30c8\u30b5\u30dd\u30fc\u30c8\u3092\u69cb\u7bc9\u3059\u308b (\u305d\u306e4) \u9023\u7d61\u5148\u306e\u8a2d\u5b9a\u3068\u307e\u3068\u3081","author":"Mako","date":"2014\u5e741\u670828\u65e5(\u706b)","format":false,"excerpt":"\u30102018\u5e744\u670820\u65e5\u8ffd\u8a18\u3011\u3053\u306e\u8a18\u4e8b\u306f\u5185\u5bb9\u304c\u53e4\u304f\u306a\u3063\u3066\u3044\u308b\u90e8\u5206\u304c\u3042\u308a\u307e\u3059\u3002\u300c\u3042\u3089\u305f\u3081\u3066\u30c1\u30e3\u30c3\u30c8\u30b5\u30dd\u30fc\u2026","rel":"","context":"Jabber\/XMPP","block_context":{"text":"Jabber\/XMPP","link":"https:\/\/pasero.net\/~mako\/blog\/s\/category\/xmpp-2"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":168,"url":"https:\/\/pasero.net\/~mako\/blog\/s\/168","url_meta":{"origin":2342,"position":4},"title":"Jabber \u3068 WordPress (\u524d\u7de8)","author":"Mako","date":"2010\u5e7411\u670824\u65e5(\u6c34)","format":false,"excerpt":"Jabber\/XMPP \u3068\u306f\u30a4\u30f3\u30b9\u30bf\u30f3\u30c8\u30e1\u30c3\u30bb\u30fc\u30b8\u30f3\u30b0\u3067\u3059\u3002Jabber \u3092\u59cb\u3081\u308b\u306b\u306f\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u3068\u2026","rel":"","context":"Jabber\/XMPP","block_context":{"text":"Jabber\/XMPP","link":"https:\/\/pasero.net\/~mako\/blog\/s\/category\/xmpp-2"},"img":{"alt_text":"Jabber \/ XMPP","src":"https:\/\/i0.wp.com\/pasero.net\/~mako\/blog\/wp-content\/uploads\/2010\/11\/pubsub1-300x225.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":537,"url":"https:\/\/pasero.net\/~mako\/blog\/s\/537","url_meta":{"origin":2342,"position":5},"title":"\u30b3\u30e1\u30f3\u30c8\u304c\u6765\u305f\u3053\u3068\u3092\u30e1\u30fc\u30eb\u4ee5\u5916\u3067\u77e5\u3089\u305b\u308b\u65b9\u6cd5","author":"Mako","date":"2013\u5e7412\u670821\u65e5(\u571f)","format":false,"excerpt":"WordPress \u306e\u30d5\u30a9\u30fc\u30e9\u30e0\u306b\u6b21\u306e\u3088\u3046\u306a\u8a71\u984c\u304c\u3042\u308a\u307e\u3057\u305f\u3002 \u300c\u30b3\u30e1\u30f3\u30c8\u304c\u6765\u305f\u3053\u3068\u3092\u77e5\u3089\u305b\u308b\u65b9\u6cd5\u3092\u2026","rel":"","context":"Jabber\/XMPP","block_context":{"text":"Jabber\/XMPP","link":"https:\/\/pasero.net\/~mako\/blog\/s\/category\/xmpp-2"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/pasero.net\/~mako\/blog\/wp-json\/wp\/v2\/posts\/2342","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pasero.net\/~mako\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pasero.net\/~mako\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pasero.net\/~mako\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/pasero.net\/~mako\/blog\/wp-json\/wp\/v2\/comments?post=2342"}],"version-history":[{"count":0,"href":"https:\/\/pasero.net\/~mako\/blog\/wp-json\/wp\/v2\/posts\/2342\/revisions"}],"wp:attachment":[{"href":"https:\/\/pasero.net\/~mako\/blog\/wp-json\/wp\/v2\/media?parent=2342"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pasero.net\/~mako\/blog\/wp-json\/wp\/v2\/categories?post=2342"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pasero.net\/~mako\/blog\/wp-json\/wp\/v2\/tags?post=2342"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}