{"id":24992084,"url":"https://github.com/strophe/strophejs-plugin-ibb","last_synced_at":"2025-07-12T13:34:14.592Z","repository":{"id":75691380,"uuid":"80017856","full_name":"strophe/strophejs-plugin-ibb","owner":"strophe","description":null,"archived":false,"fork":false,"pushed_at":"2017-02-06T12:27:27.000Z","size":3,"stargazers_count":2,"open_issues_count":1,"forks_count":7,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-06-19T05:08:36.176Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/strophe.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-01-25T13:40:24.000Z","updated_at":"2018-12-29T05:06:51.000Z","dependencies_parsed_at":"2023-05-03T23:30:56.937Z","dependency_job_id":null,"html_url":"https://github.com/strophe/strophejs-plugin-ibb","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/strophe/strophejs-plugin-ibb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strophe%2Fstrophejs-plugin-ibb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strophe%2Fstrophejs-plugin-ibb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strophe%2Fstrophejs-plugin-ibb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strophe%2Fstrophejs-plugin-ibb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/strophe","download_url":"https://codeload.github.com/strophe/strophejs-plugin-ibb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strophe%2Fstrophejs-plugin-ibb/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265002539,"owners_count":23696075,"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-02-04T13:53:42.126Z","updated_at":"2025-07-12T13:34:14.587Z","avatar_url":"https://github.com/strophe.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"XEP-0047: In-Band Bytestreams\n=============================\n\nhttp://xmpp.org/extensions/xep-0047.html\n\n\u003e This specification defines an XMPP protocol extension that enables any two entities to establish a one-to-one bytestream between themselves, where the data is broken down into smaller chunks and transported in-band over XMPP.\n\nUsage\n-----\n\nInclude the stream initiation and ibb plugins in the head.\n\n``` html\n\u003chead\u003e\n\u003c!-- ... --\u003e\n\u003cscript type=\"text/javascript\" src=\"strophe.min.js\"\u003e\u003c/script\u003e\n\u003cscript type=\"text/javascript\" src=\"strophe.si-filetransfer.js\"\u003e\u003c/script\u003e\n\u003cscript type=\"text/javascript\" src=\"strophe.ibb.js\"\u003e\u003c/script\u003e\n\u003c!-- ... --\u003e\n\u003c/head\u003e\n```\n\nAdd handlers to listen for stream initiations and files, or use the api to send files of your own.\n\n``` javascript\nvar connection = new Strophe.Connection();\n\nvar fileHandler = function(from, sid, filename, size, mime) {\n\t// received a stream initiation\n  // save to data and be prepared to receive the file.\n};\nconnection.si_filetransfer.addFileHandler(fileHandler);\n\nvar ibbHandler = function (type, from, sid, data, seq) {\n\tswitch(type) {\n    case \"open\":\n      // new file, only metadata\n      break;\n    case \"data\":\n      // data\n      break;\n    case \"close\":\n      // and we're done\n    default:\n      throw new Error(\"shouldn't be here.\")\n  }\n};\nconnection.ibb.addIBBHandler(ibbHandler);\n\n// send a stream initiation\nconnection.si_filetransfer.send(to, sid, filename, filesize, mime, function (err) {\n  if (err) {\n    return console.log(err);\n  }\n  // successfully initiated the transfer, now open the band\n  connection.ibb.open(to, sid, chunksize, function (err) {\n    if (err) {\n      return console.log(err);\n    }\n    // stream is open, start sending chunks of data\n    connection.ibb.data(to, sid, seq, msg, function (err) {\n      if (err) {\n        return console.log(err);\n      }\n      // ... repeat calling data\n      // keep sending until you're ready you've reached the end of the file\n      connection.ibb.close(to, sid, function (err) {\n        if (err) {\n          return console.log(err);\n        }\n        // done\n      });\n    });\n  });\n});\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrophe%2Fstrophejs-plugin-ibb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstrophe%2Fstrophejs-plugin-ibb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrophe%2Fstrophejs-plugin-ibb/lists"}