{"id":28724155,"url":"https://github.com/processone/p1pp-js","last_synced_at":"2025-06-15T10:09:22.078Z","repository":{"id":2417443,"uuid":"3385727","full_name":"processone/p1pp-js","owner":"processone","description":"ProcessOne Push Platform Javascript library","archived":false,"fork":false,"pushed_at":"2012-03-14T17:01:33.000Z","size":595,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":10,"default_branch":"master","last_synced_at":"2023-03-10T23:08:39.280Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":"Unmaintained","scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/processone.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-02-08T09:11:04.000Z","updated_at":"2018-09-30T10:55:06.000Z","dependencies_parsed_at":"2022-08-28T06:12:19.130Z","dependency_job_id":null,"html_url":"https://github.com/processone/p1pp-js","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"purl":"pkg:github/processone/p1pp-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/processone%2Fp1pp-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/processone%2Fp1pp-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/processone%2Fp1pp-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/processone%2Fp1pp-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/processone","download_url":"https://codeload.github.com/processone/p1pp-js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/processone%2Fp1pp-js/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259957280,"owners_count":22937549,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-15T10:09:20.912Z","updated_at":"2025-06-15T10:09:22.062Z","avatar_url":"https://github.com/processone.png","language":"JavaScript","readme":"# About P1PP\n\n\nP1PP is a simple-to-use javascript client for connecting to an XMPP pubsub service. It will use WebSockets if possible or degrade to BOSH.\n\n## Building\n\nIn the Makefile, if you want to use minification, set GOOGLE_CC and JAVA variables to correct locations\n\nThen typing ``make`` will generate P1PP.js file and ``make minified`` minified version of that file: P1PP.js.min\n\n## Usage\n\n\n### P1PP.connect()\n\n\nThis function connects to server and allows you to pass configuration parameters used by other functions.\n\nExample:\n\n    P1PP.connect({\n      jid: 'myaccount@test.server.com',\n      password: '*****',\n      domain: 'test.server.com',\n      nodes: ['my-test-node'],\n      debug: true\n    })\n\nYou can pass those parameters to alter library configuration:\n\n* **jid** - JID of account to used (optional). If none is passed anonymous connection will be performed.\n\n* **password** - password for used account (optional). This field is only required when jid is passed as well.\n\n* **ws_url** - Url to websocket service. Default value is \"ws://p1pp.net:5280/xmpp\"\n\n* **bosh_url** - Url to http-bind service. Default value is \"ws://p1pp.net:5280/http-bind\"\n\n* **domain** - Domain used by xmpp server. Default value is \"p1pp.net\"\n\n* **rebind** - When set to true, reconnecting to server after page reload will try to use fast rebind method\n\n* **flash_location** - Path to place where flash helper script is available, defaults to \"WebSocketMain.swf\"\n\n* **nodes** - List of nodes to subscribe to\n\n* **connect_delay** - Wait this much milliseconds before starting connecting to server. Default value is 0\n\n* **connect_retry** - How much times reconnection should be tried before failing completely\n\n* **connect_timeout** - Time in milliseconds before reconnections\n\n* **debug** - If set to true, debug messages will be delivered using console.info interface\n\n* **publish** - Callback function called when a new value is published in any of subscribed node.\n  This function should have a signature similar to ``function(id, value, node, timestamp)``, \n  * ``id`` - identifier of received value, identical value will be used if that value will be retracted\n  * ``value`` - published value content, DOM element\n  * ``node`` - name of node in which that value was published\n  * ``timestamp`` - string with date when node was published, may be ``null``\n\n* **retract** - Callback called when value was deleted from one of subscribed node, this callback should be\n  function with this signature ``function(id, node)``, ``id`` is a string identifying retracted value, and\n  ``node`` is a node name where retracted value was stored\n\n* **on_strophe_event** - Callback called when underlying strophe connection state is changed, it's called with one of\n  ``Strophe.Status.*`` values as argument.\n\n\n### P1PP.disconnect()\n\n\nCloses connection to server\n\nExample:\n\n    P1PP.disconnect()\n\n\n### P1PP.subscribeToNode()\n\n\nSubscribes to new node or nodes\n\nExample:\n\n    P1PP.subscribeToNode(['timer@test.server.com/timer1', 'timer@test.server.com/timer2'])\n\nThis function takes list of strings with nodes, of single string with node as its argument\n\n### P1PP.unsubscribeFromNode()\n\nStop subscribing to changes performed in node or nodes\n\nExample:\n\n    P1PP.unsubscribeFromNode(['timer@test.server.com/timer1', 'timer@test.server.com/timer2'])\n\nThis function takes list of strings with nodes, of single string with node as its argument\n\n\n### P1PP.publish()\n\n\nPublish new data in node\n\nExample:\n\n    P1PP.publish('timer', timer_event_id, timer_event_value, my_publish_callback)\n\nThis function takes 3 or 4 arguments, as first argument string with name of node should be passed.\nSecond argument is used as identifier of value to send, when ``null`` is used, random name is generated.\nThird argument should be DOM element with stored value.\nFourth should be callback, it's called when server request store operation finished, it's called with two\narguments, identifier of stored value, and success (value \"ok\") or error code as second parameter.\n\nThis function returns identifier used to store value, it's equal to second value passed to this function,\nor generated value if ``null`` was passed to function.\n\n\n### P1PP.deleteNode()\n\n\nDeletes node from server\n\nExample:\n\n    P1PP.deleteNode('geolocation@test.server.com/locations', my_delete_callback)\n\nTakes string with name of node to delete, and optional callback function called when operation finishes.\nCallback is called with \"ok\" when operation was completed successfully, or string with error code otherwise.\n\n\n### Access to underlying strophe connection\n\n\nIt's possible to get access to ``Strophe.Connection`` object used internally\nby P1PP. That object is available as ``P1PP.push_client.connection`` and\nonly when connection was established, which may be determined by listening\nto events delivered through **on_strophe_event** callback.\n\n\n## Third party libraries used\n\n\nStropheJS is licensed under the MIT license, except for the embedded files\nbase64.js and md5.js, which are licensed as public domain and\nBSD.\nCanonical repository is https://github.com/metajack/strophejs\n\n--------------\n\nFABridge, embedded with web-socket-js license:\nCopyright 2006 Adobe Systems Incorporated\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"),\nto deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,\nand/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE\nOR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n--------------\n\nweb-socket-js is licensed under New BSD License.\nCanonical repository is https://github.com/gimite/web-socket-js\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprocessone%2Fp1pp-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprocessone%2Fp1pp-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprocessone%2Fp1pp-js/lists"}