Explorar o código

Bugfix: Set protocol after discovering connection methods

Otherwise if an endpoint was passed in with `converse.initialize`, then
that endpoint's protocol is (wrongly) used.
JC Brand %!s(int64=4) %!d(string=hai) anos
pai
achega
21dfd8a325
Modificáronse 4 ficheiros con 206 adicións e 90 borrados
  1. 204 83
      package-lock.json
  2. 1 0
      src/headless/connection.js
  3. 0 6
      src/headless/converse-core.js
  4. 1 1
      src/headless/package.json

+ 204 - 83
package-lock.json

@@ -3144,8 +3144,7 @@
 			"dependencies": {
 				"filesize": {
 					"version": "6.1.0",
-					"resolved": "https://registry.npmjs.org/filesize/-/filesize-6.1.0.tgz",
-					"integrity": "sha512-LpCHtPQ3sFx67z+uh2HnSyWSLLu5Jxo21795uRDuar/EOuYWXib5EmPaGIBuSnRqH2IODiKA2k5re/K9OnN/Yg=="
+					"resolved": false
 				},
 				"fs-extra": {
 					"version": "8.1.0",
@@ -3201,22 +3200,20 @@
 				},
 				"localforage": {
 					"version": "1.7.3",
-					"resolved": "https://registry.npmjs.org/localforage/-/localforage-1.7.3.tgz",
-					"integrity": "sha512-1TulyYfc4udS7ECSBT2vwJksWbkwwTX8BzeUIiq8Y07Riy7bDAAnxDaPU/tWyOVmQAcWJIEIFP9lPfBGqVoPgQ==",
+					"resolved": false,
 					"requires": {
 						"lie": "3.1.1"
 					}
 				},
 				"pluggable.js": {
 					"version": "2.0.1",
-					"resolved": "https://registry.npmjs.org/pluggable.js/-/pluggable.js-2.0.1.tgz",
-					"integrity": "sha512-SBt6v6Tbp20Jf8hU0cpcc/+HBHGMY8/Q+yA6Ih0tBQE8tfdZ6U4PRG0iNvUUjLx/hVyOP53n0UfGBymlfaaXCg==",
+					"resolved": false,
 					"requires": {
 						"lodash": "^4.17.11"
 					}
 				},
 				"skeletor.js": {
-					"version": "github:skeletorjs/skeletor#bf6d9c86f9fcf224fa9d9af5a25380b77aa4b561",
+					"version": "0.0.1",
 					"from": "github:skeletorjs/skeletor#bf6d9c86f9fcf224fa9d9af5a25380b77aa4b561",
 					"requires": {
 						"lodash": "^4.17.14"
@@ -3224,11 +3221,7 @@
 				},
 				"strophe.js": {
 					"version": "github:strophe/strophejs#c4a94e59877c06dc2395f4ccbd26f3fee67a4c9f",
-					"from": "strophe.js@github:strophe/strophejs#c4a94e59877c06dc2395f4ccbd26f3fee67a4c9f",
-					"requires": {
-						"abab": "^2.0.3",
-						"xmldom": "^0.1.27"
-					}
+					"from": "strophe.js@github:strophe/strophejs#c4a94e59877c06dc2395f4ccbd26f3fee67a4c9f"
 				},
 				"twemoji": {
 					"version": "12.1.5",
@@ -4835,18 +4828,18 @@
 			}
 		},
 		"@octokit/auth-token": {
-			"version": "2.4.2",
-			"resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.4.2.tgz",
-			"integrity": "sha512-jE/lE/IKIz2v1+/P0u4fJqv0kYwXOTujKemJMFr6FeopsxlIK3+wKDCJGnysg81XID5TgZQbIfuJ5J0lnTiuyQ==",
+			"version": "2.4.3",
+			"resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.4.3.tgz",
+			"integrity": "sha512-fdGoOQ3kQJh+hrilc0Plg50xSfaCKOeYN9t6dpJKXN9BxhhfquL0OzoQXg3spLYymL5rm29uPeI3KEXRaZQ9zg==",
 			"dev": true,
 			"requires": {
 				"@octokit/types": "^5.0.0"
 			}
 		},
 		"@octokit/endpoint": {
-			"version": "6.0.8",
-			"resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.8.tgz",
-			"integrity": "sha512-MuRrgv+bM4Q+e9uEvxAB/Kf+Sj0O2JAOBA131uo1o6lgdq1iS8ejKwtqHgdfY91V3rN9R/hdGKFiQYMzVzVBEQ==",
+			"version": "6.0.9",
+			"resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.9.tgz",
+			"integrity": "sha512-3VPLbcCuqji4IFTclNUtGdp9v7g+nspWdiCUbK3+iPMjJCZ6LEhn1ts626bWLOn0GiDb6j+uqGvPpqLnY7pBgw==",
 			"dev": true,
 			"requires": {
 				"@octokit/types": "^5.0.0",
@@ -4895,9 +4888,9 @@
 			}
 		},
 		"@octokit/plugin-request-log": {
-			"version": "1.0.0",
-			"resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.0.tgz",
-			"integrity": "sha512-ywoxP68aOT3zHCLgWZgwUJatiENeHE7xJzYjfz8WI0goynp96wETBF+d95b8g/uL4QmS6owPVlaxiz3wyMAzcw==",
+			"version": "1.0.2",
+			"resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.2.tgz",
+			"integrity": "sha512-oTJSNAmBqyDR41uSMunLQKMX0jmEXbwD1fpz8FG27lScV3RhtGfBa1/BBLym+PxcC16IBlF7KH9vP1BUYxA+Eg==",
 			"dev": true
 		},
 		"@octokit/plugin-rest-endpoint-methods": {
@@ -4922,9 +4915,9 @@
 			}
 		},
 		"@octokit/request": {
-			"version": "5.4.9",
-			"resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.4.9.tgz",
-			"integrity": "sha512-CzwVvRyimIM1h2n9pLVYfTDmX9m+KHSgCpqPsY8F1NdEK8IaWqXhSBXsdjOBFZSpEcxNEeg4p0UO9cQ8EnOCLA==",
+			"version": "5.4.10",
+			"resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.4.10.tgz",
+			"integrity": "sha512-egA49HkqEORVGDZGav1mh+VD+7uLgOxtn5oODj6guJk0HCy+YBSYapFkSLFgeYj3Fr18ZULKGURkjyhkAChylw==",
 			"dev": true,
 			"requires": {
 				"@octokit/endpoint": "^6.0.1",
@@ -4938,9 +4931,9 @@
 			},
 			"dependencies": {
 				"@octokit/request-error": {
-					"version": "2.0.2",
-					"resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.0.2.tgz",
-					"integrity": "sha512-2BrmnvVSV1MXQvEkrb9zwzP0wXFNbPJij922kYBTLIlIafukrGOb+ABBT2+c6wZiuyWDH1K1zmjGQ0toN/wMWw==",
+					"version": "2.0.3",
+					"resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.0.3.tgz",
+					"integrity": "sha512-GgD5z8Btm301i2zfvJLk/mkhvGCdjQ7wT8xF9ov5noQY8WbKZDH9cOBqXzoeKd1mLr1xH2FwbtGso135zGBgTA==",
 					"dev": true,
 					"requires": {
 						"@octokit/types": "^5.0.1",
@@ -5110,9 +5103,9 @@
 			"dev": true
 		},
 		"@types/minimist": {
-			"version": "1.2.0",
-			"resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.0.tgz",
-			"integrity": "sha1-aaI6OtKcrwCX8G7aWbNh7i8GOfY=",
+			"version": "1.2.1",
+			"resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.1.tgz",
+			"integrity": "sha512-fZQQafSREFyuZcdWFAExYjBiCL7AUCdgsk80iO0q4yihYYdcIiH28CcuPTGFgLOCC8RlW49GSQxdHwZP+I7CNg==",
 			"dev": true
 		},
 		"@types/node": {
@@ -7415,9 +7408,9 @@
 			"dev": true
 		},
 		"conventional-changelog-angular": {
-			"version": "5.0.11",
-			"resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-5.0.11.tgz",
-			"integrity": "sha512-nSLypht/1yEflhuTogC03i7DX7sOrXGsRn14g131Potqi6cbGbGEE9PSDEHKldabB6N76HiSyw9Ph+kLmC04Qw==",
+			"version": "5.0.12",
+			"resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-5.0.12.tgz",
+			"integrity": "sha512-5GLsbnkR/7A89RyHLvvoExbiGbd9xKdKqDTrArnPbOqBqG/2wIosu0fHwpeIRI8Tl94MhVNBXcLJZl92ZQ5USw==",
 			"dev": true,
 			"requires": {
 				"compare-func": "^2.0.0",
@@ -7470,27 +7463,38 @@
 			"dev": true
 		},
 		"conventional-changelog-writer": {
-			"version": "4.0.17",
-			"resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-4.0.17.tgz",
-			"integrity": "sha512-IKQuK3bib/n032KWaSb8YlBFds+aLmzENtnKtxJy3+HqDq5kohu3g/UdNbIHeJWygfnEbZjnCKFxAW0y7ArZAw==",
+			"version": "4.0.18",
+			"resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-4.0.18.tgz",
+			"integrity": "sha512-mAQDCKyB9HsE8Ko5cCM1Jn1AWxXPYV0v8dFPabZRkvsiWUul2YyAqbIaoMKF88Zf2ffnOPSvKhboLf3fnjo5/A==",
 			"dev": true,
 			"requires": {
 				"compare-func": "^2.0.0",
-				"conventional-commits-filter": "^2.0.6",
+				"conventional-commits-filter": "^2.0.7",
 				"dateformat": "^3.0.0",
 				"handlebars": "^4.7.6",
 				"json-stringify-safe": "^5.0.1",
 				"lodash": "^4.17.15",
-				"meow": "^7.0.0",
+				"meow": "^8.0.0",
 				"semver": "^6.0.0",
 				"split": "^1.0.0",
-				"through2": "^3.0.0"
+				"through2": "^4.0.0"
 			},
 			"dependencies": {
-				"inherits": {
-					"version": "2.0.4",
-					"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
-					"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
+				"readable-stream": {
+					"version": "3.6.0",
+					"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
+					"integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
+					"dev": true,
+					"requires": {
+						"inherits": "^2.0.3",
+						"string_decoder": "^1.1.1",
+						"util-deprecate": "^1.0.1"
+					}
+				},
+				"safe-buffer": {
+					"version": "5.2.1",
+					"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
+					"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
 					"dev": true
 				},
 				"semver": {
@@ -7499,22 +7503,30 @@
 					"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
 					"dev": true
 				},
+				"string_decoder": {
+					"version": "1.3.0",
+					"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
+					"integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
+					"dev": true,
+					"requires": {
+						"safe-buffer": "~5.2.0"
+					}
+				},
 				"through2": {
-					"version": "3.0.2",
-					"resolved": "https://registry.npmjs.org/through2/-/through2-3.0.2.tgz",
-					"integrity": "sha512-enaDQ4MUyP2W6ZyT6EsMzqBPZaM/avg8iuo+l2d3QCs0J+6RaqkHV/2/lOwDTueBHeJ/2LG9lrLW3d5rWPucuQ==",
+					"version": "4.0.2",
+					"resolved": "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz",
+					"integrity": "sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==",
 					"dev": true,
 					"requires": {
-						"inherits": "^2.0.4",
-						"readable-stream": "2 || 3"
+						"readable-stream": "3"
 					}
 				}
 			}
 		},
 		"conventional-commits-filter": {
-			"version": "2.0.6",
-			"resolved": "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-2.0.6.tgz",
-			"integrity": "sha512-4g+sw8+KA50/Qwzfr0hL5k5NWxqtrOVw4DDk3/h6L85a9Gz0/Eqp3oP+CWCNfesBvZZZEFHF7OTEbRe+yYSyKw==",
+			"version": "2.0.7",
+			"resolved": "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-2.0.7.tgz",
+			"integrity": "sha512-ASS9SamOP4TbCClsRHxIHXRfcGCnIoQqkvAzCSbZzTFLfcTqJVugB0agRgsEELsqaeWgsXv513eS116wnlSSPA==",
 			"dev": true,
 			"requires": {
 				"lodash.ismatch": "^4.4.0",
@@ -7522,34 +7534,53 @@
 			}
 		},
 		"conventional-commits-parser": {
-			"version": "3.1.0",
-			"resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-3.1.0.tgz",
-			"integrity": "sha512-RSo5S0WIwXZiRxUGTPuYFbqvrR4vpJ1BDdTlthFgvHt5kEdnd1+pdvwWphWn57/oIl4V72NMmOocFqqJ8mFFhA==",
+			"version": "3.2.0",
+			"resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-3.2.0.tgz",
+			"integrity": "sha512-XmJiXPxsF0JhAKyfA2Nn+rZwYKJ60nanlbSWwwkGwLQFbugsc0gv1rzc7VbbUWAzJfR1qR87/pNgv9NgmxtBMQ==",
 			"dev": true,
 			"requires": {
 				"JSONStream": "^1.0.4",
 				"is-text-path": "^1.0.1",
 				"lodash": "^4.17.15",
-				"meow": "^7.0.0",
+				"meow": "^8.0.0",
 				"split2": "^2.0.0",
-				"through2": "^3.0.0",
+				"through2": "^4.0.0",
 				"trim-off-newlines": "^1.0.0"
 			},
 			"dependencies": {
-				"inherits": {
-					"version": "2.0.4",
-					"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
-					"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
+				"readable-stream": {
+					"version": "3.6.0",
+					"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
+					"integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
+					"dev": true,
+					"requires": {
+						"inherits": "^2.0.3",
+						"string_decoder": "^1.1.1",
+						"util-deprecate": "^1.0.1"
+					}
+				},
+				"safe-buffer": {
+					"version": "5.2.1",
+					"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
+					"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
 					"dev": true
 				},
+				"string_decoder": {
+					"version": "1.3.0",
+					"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
+					"integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
+					"dev": true,
+					"requires": {
+						"safe-buffer": "~5.2.0"
+					}
+				},
 				"through2": {
-					"version": "3.0.2",
-					"resolved": "https://registry.npmjs.org/through2/-/through2-3.0.2.tgz",
-					"integrity": "sha512-enaDQ4MUyP2W6ZyT6EsMzqBPZaM/avg8iuo+l2d3QCs0J+6RaqkHV/2/lOwDTueBHeJ/2LG9lrLW3d5rWPucuQ==",
+					"version": "4.0.2",
+					"resolved": "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz",
+					"integrity": "sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==",
 					"dev": true,
 					"requires": {
-						"inherits": "^2.0.4",
-						"readable-stream": "2 || 3"
+						"readable-stream": "3"
 					}
 				}
 			}
@@ -8017,9 +8048,9 @@
 			}
 		},
 		"core-js": {
-			"version": "2.6.11",
-			"resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.11.tgz",
-			"integrity": "sha512-5wjnpaT/3dV+XB4borEsnAYQchn00XSgTAWKDkEqv+K8KevjbzmofK6hfJ9TZIlpj2N0xQpazy7PiRQiWHqzWg=="
+			"version": "2.6.12",
+			"resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz",
+			"integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ=="
 		},
 		"core-js-compat": {
 			"version": "3.6.5",
@@ -11588,9 +11619,9 @@
 			}
 		},
 		"git-url-parse": {
-			"version": "11.3.0",
-			"resolved": "https://registry.npmjs.org/git-url-parse/-/git-url-parse-11.3.0.tgz",
-			"integrity": "sha512-i3XNa8IKmqnUqWBcdWBjOcnyZYfN3C1WRvnKI6ouFWwsXCZEnlgbwbm55ZpJ3OJMhfEP/ryFhqW8bBhej3C5Ug==",
+			"version": "11.4.0",
+			"resolved": "https://registry.npmjs.org/git-url-parse/-/git-url-parse-11.4.0.tgz",
+			"integrity": "sha512-KlIa5jvMYLjXMQXkqpFzobsyD/V2K5DRHl5OAf+6oDFPlPLxrGDVQlIdI63c4/Kt6kai4kALENSALlzTGST3GQ==",
 			"dev": true,
 			"requires": {
 				"git-up": "^4.0.0"
@@ -12661,6 +12692,15 @@
 				"ci-info": "^2.0.0"
 			}
 		},
+		"is-core-module": {
+			"version": "2.2.0",
+			"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.2.0.tgz",
+			"integrity": "sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==",
+			"dev": true,
+			"requires": {
+				"has": "^1.0.3"
+			}
+		},
 		"is-data-descriptor": {
 			"version": "0.1.4",
 			"resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz",
@@ -14067,9 +14107,9 @@
 			}
 		},
 		"meow": {
-			"version": "7.1.1",
-			"resolved": "https://registry.npmjs.org/meow/-/meow-7.1.1.tgz",
-			"integrity": "sha512-GWHvA5QOcS412WCo8vwKDlTelGLsCGBVevQB5Kva961rmNfun0PCbv5+xta2kUMFJyR8/oWnn7ddeKdosbAPbA==",
+			"version": "8.0.0",
+			"resolved": "https://registry.npmjs.org/meow/-/meow-8.0.0.tgz",
+			"integrity": "sha512-nbsTRz2fwniJBFgUkcdISq8y/q9n9VbiHYbfwklFh5V4V2uAcxtKQkDc0yCLPM/kP0d+inZBewn3zJqewHE7kg==",
 			"dev": true,
 			"requires": {
 				"@types/minimist": "^1.2.0",
@@ -14077,12 +14117,12 @@
 				"decamelize-keys": "^1.1.0",
 				"hard-rejection": "^2.1.0",
 				"minimist-options": "4.1.0",
-				"normalize-package-data": "^2.5.0",
+				"normalize-package-data": "^3.0.0",
 				"read-pkg-up": "^7.0.1",
 				"redent": "^3.0.0",
 				"trim-newlines": "^3.0.0",
-				"type-fest": "^0.13.1",
-				"yargs-parser": "^18.1.3"
+				"type-fest": "^0.18.0",
+				"yargs-parser": "^20.2.3"
 			},
 			"dependencies": {
 				"find-up": {
@@ -14095,6 +14135,15 @@
 						"path-exists": "^4.0.0"
 					}
 				},
+				"hosted-git-info": {
+					"version": "3.0.7",
+					"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-3.0.7.tgz",
+					"integrity": "sha512-fWqc0IcuXs+BmE9orLDyVykAG9GJtGLGuZAAqgcckPgv5xad4AcXGIv8galtQvlwutxSlaMcdw7BUtq2EIvqCQ==",
+					"dev": true,
+					"requires": {
+						"lru-cache": "^6.0.0"
+					}
+				},
 				"locate-path": {
 					"version": "5.0.0",
 					"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
@@ -14104,6 +14153,27 @@
 						"p-locate": "^4.1.0"
 					}
 				},
+				"lru-cache": {
+					"version": "6.0.0",
+					"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
+					"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
+					"dev": true,
+					"requires": {
+						"yallist": "^4.0.0"
+					}
+				},
+				"normalize-package-data": {
+					"version": "3.0.0",
+					"resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.0.tgz",
+					"integrity": "sha512-6lUjEI0d3v6kFrtgA/lOx4zHCWULXsFNIjHolnZCKCTLA6m/G625cdn3O7eNmT0iD3jfo6HZ9cdImGZwf21prw==",
+					"dev": true,
+					"requires": {
+						"hosted-git-info": "^3.0.6",
+						"resolve": "^1.17.0",
+						"semver": "^7.3.2",
+						"validate-npm-package-license": "^3.0.1"
+					}
+				},
 				"p-locate": {
 					"version": "4.1.0",
 					"resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz",
@@ -14143,6 +14213,30 @@
 						"type-fest": "^0.6.0"
 					},
 					"dependencies": {
+						"hosted-git-info": {
+							"version": "2.8.8",
+							"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz",
+							"integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==",
+							"dev": true
+						},
+						"normalize-package-data": {
+							"version": "2.5.0",
+							"resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz",
+							"integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==",
+							"dev": true,
+							"requires": {
+								"hosted-git-info": "^2.1.4",
+								"resolve": "^1.10.0",
+								"semver": "2 || 3 || 4 || 5",
+								"validate-npm-package-license": "^3.0.1"
+							}
+						},
+						"semver": {
+							"version": "5.7.1",
+							"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
+							"integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
+							"dev": true
+						},
 						"type-fest": {
 							"version": "0.6.0",
 							"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz",
@@ -14170,10 +14264,38 @@
 						}
 					}
 				},
+				"resolve": {
+					"version": "1.19.0",
+					"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz",
+					"integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==",
+					"dev": true,
+					"requires": {
+						"is-core-module": "^2.1.0",
+						"path-parse": "^1.0.6"
+					}
+				},
+				"semver": {
+					"version": "7.3.2",
+					"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz",
+					"integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==",
+					"dev": true
+				},
 				"type-fest": {
-					"version": "0.13.1",
-					"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz",
-					"integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==",
+					"version": "0.18.1",
+					"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.18.1.tgz",
+					"integrity": "sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw==",
+					"dev": true
+				},
+				"yallist": {
+					"version": "4.0.0",
+					"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
+					"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
+					"dev": true
+				},
+				"yargs-parser": {
+					"version": "20.2.4",
+					"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz",
+					"integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==",
 					"dev": true
 				}
 			}
@@ -22782,9 +22904,8 @@
 			}
 		},
 		"strophe.js": {
-			"version": "1.4.0",
-			"resolved": "https://registry.npmjs.org/strophe.js/-/strophe.js-1.4.0.tgz",
-			"integrity": "sha512-Y+Smiwb2Q+bMqd0b7k5Qp46y3MvyxOTB+qANcL5W+UPlTWMlJZkdR7KkPFeqSMn7UTNnZa1yhkdWYqCu2SITPQ==",
+			"version": "github:strophe/strophejs#4f9b094ecef4be0d473f92965c5ffb654510a598",
+			"from": "github:strophe/strophejs#4f9b094ecef4be0d473f92965c5ffb654510a598",
 			"requires": {
 				"abab": "^2.0.3",
 				"ws": "^7.0.0",

+ 1 - 0
src/headless/connection.js

@@ -53,6 +53,7 @@ export class Connection extends Strophe.Connection {
             api.settings.set("websocket_url", ws_methods.pop());
             api.settings.set('bosh_service_url', bosh_methods.pop());
             this.service = api.settings.get("websocket_url") || api.settings.get('bosh_service_url');
+            this.setProtocol();
         }
     }
 

+ 0 - 6
src/headless/converse-core.js

@@ -789,7 +789,6 @@ export const api = _converse.api = {
     listen: {
         /**
          * Lets you listen to an event exactly once.
-         *
          * @method _converse.api.listen.once
          * @param {string} name The event's name
          * @param {function} callback The callback method to be called when the event is emitted.
@@ -800,9 +799,7 @@ export const api = _converse.api = {
 
         /**
          * Lets you subscribe to an event.
-         *
          * Every time the event fires, the callback method specified by `callback` will be called.
-         *
          * @method _converse.api.listen.on
          * @param {string} name The event's name
          * @param {function} callback The callback method to be called when the event is emitted.
@@ -813,9 +810,6 @@ export const api = _converse.api = {
 
         /**
          * To stop listening to an event, you can use the `not` method.
-         *
-         * Every time the event fires, the callback method specified by `callback` will be called.
-         *
          * @method _converse.api.listen.not
          * @param {string} name The event's name
          * @param {function} callback The callback method that is to no longer be called when the event fires

+ 1 - 1
src/headless/package.json

@@ -43,6 +43,6 @@
     "lodash-es": "^4.17.15",
     "pluggable.js": "2.0.1",
     "sprintf-js": "^1.1.2",
-    "strophe.js": "1.4.0"
+    "strophe.js": "strophe/strophejs#4f9b094ecef4be0d473f92965c5ffb654510a598"
   }
 }