xmpp.js icon indicating copy to clipboard operation
xmpp.js copied to clipboard

BOSH/HTTP transport for client

Open sonnyp opened this issue 5 years ago • 8 comments

sonnyp avatar Aug 31 '18 13:08 sonnyp

any hope for implementing it?

174n avatar Apr 03 '19 17:04 174n

Any update?

IrfDev avatar May 31 '21 23:05 IrfDev

Is this still a goal of the project? Interestingly, Prosody documentation thinks that xmpp.js supports BOSH already and it's listed as a tested client library.

VA1DER avatar Aug 18 '23 02:08 VA1DER

Is this project still active? I'd like to implement BOSH support, but I'll need someone to help me with that.

vampirefrog avatar Dec 16 '23 20:12 vampirefrog

PR welcome - I'm happy to review it.

I wrote a BOSH client before - you can reuse the code https://github.com/sonnyp/lightstring/blob/master/src/transports/bosh.js

It should use fetch instead of XMLHttpRequest though and @xmpp/xml for xml.

sonnyp avatar Dec 16 '23 23:12 sonnyp

Well, I'm not sure where to start, running npm install comes up with this error:

$ npm i
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: The zlib module provides APIs for brotli compression/decompression starting with Node.js v10.16.0, please use it over iltorb
npm WARN deprecated [email protected]: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
npm ERR! code 1
npm ERR! path /home/vampi/Code/xmpp.js/node_modules/iltorb
npm ERR! command failed
npm ERR! command sh -c node ./scripts/install.js || node-gyp rebuild
npm ERR! info install installing standalone, skipping download.
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | linux | x64
npm ERR! gyp info find Python using Python version 3.11.2 found at "/usr/bin/python"
npm ERR! (node:920343) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
npm ERR! (Use `node --trace-deprecation ...` to show where the warning was created)
npm ERR! gyp info spawn /usr/bin/python
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/home/vampi/Code/xmpp.js/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'make',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/vampi/Code/xmpp.js/node_modules/iltorb/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/vampi/Code/xmpp.js/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/vampi/.cache/node-gyp/18.13.0/include/node/common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=/home/vampi/.cache/node-gyp/18.13.0',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/home/vampi/Code/xmpp.js/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/home/vampi/.cache/node-gyp/18.13.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/home/vampi/Code/xmpp.js/node_modules/iltorb',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! Traceback (most recent call last):
npm ERR!   File "/home/vampi/Code/xmpp.js/node_modules/node-gyp/gyp/gyp_main.py", line 50, in <module>
npm ERR!     sys.exit(gyp.script_main())
npm ERR!              ^^^^^^^^^^^^^^^^^
npm ERR!   File "/home/vampi/Code/xmpp.js/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 554, in script_main
npm ERR!     return main(sys.argv[1:])
npm ERR!            ^^^^^^^^^^^^^^^^^^
npm ERR!   File "/home/vampi/Code/xmpp.js/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 547, in main
npm ERR!     return gyp_main(args)
npm ERR!            ^^^^^^^^^^^^^^
npm ERR!   File "/home/vampi/Code/xmpp.js/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 520, in gyp_main
npm ERR!     [generator, flat_list, targets, data] = Load(
npm ERR!                                             ^^^^^
npm ERR!   File "/home/vampi/Code/xmpp.js/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 136, in Load
npm ERR!     result = gyp.input.Load(build_files, default_variables, includes[:],
npm ERR!              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
npm ERR!   File "/home/vampi/Code/xmpp.js/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 2782, in Load
npm ERR!     LoadTargetBuildFile(build_file, data, aux_data,
npm ERR!   File "/home/vampi/Code/xmpp.js/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 391, in LoadTargetBuildFile
npm ERR!     build_file_data = LoadOneBuildFile(build_file_path, data, aux_data,
npm ERR!                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
npm ERR!   File "/home/vampi/Code/xmpp.js/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 234, in LoadOneBuildFile
npm ERR!     build_file_contents = open(build_file_path, 'rU').read()
npm ERR!                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
npm ERR! ValueError: invalid mode: 'rU' while trying to load binding.gyp
npm ERR! gyp ERR! configure error 
npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
npm ERR! gyp ERR! stack     at ChildProcess.onCpExit (/home/vampi/Code/xmpp.js/node_modules/node-gyp/lib/configure.js:351:16)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Linux 6.1.0-14-amd64
npm ERR! gyp ERR! command "/usr/bin/node" "/home/vampi/Code/xmpp.js/node_modules/.bin/node-gyp" "rebuild"
npm ERR! gyp ERR! cwd /home/vampi/Code/xmpp.js/node_modules/iltorb
npm ERR! gyp ERR! node -v v18.13.0
npm ERR! gyp ERR! node-gyp -v v5.1.1
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/vampi/.npm/_logs/2023-12-17T00_17_18_712Z-debug-0.log

$ npm --version
9.2.0

$ node --version
v18.13.0

vampirefrog avatar Dec 17 '23 00:12 vampirefrog

Some dependency is pulling iltorb which doesn't build with your npm/node versions. Since the repo is archived - your best best is finding which dependency depends on iltorb and look for an update or workaround.

sonnyp avatar Dec 17 '23 00:12 sonnyp

Nevermind, I just threw my own BOSH/XMPP client together so I don't have to deal with all the npm nonsense. Just FYI, the package failing is bundlesize.

vampirefrog avatar Dec 17 '23 03:12 vampirefrog