Make sure to use HTTPS when utilizing node-xmpp-bosh, as only HTTP is supported

Overview

I have been using converse.js as my XMPP webclient. In order for it to function properly, I require a bosh server that can handle bidirectional communication. The current server I am using is node-xmpp-bosh. However, due to the SSL/TLS encryption on my website which is only accessible via https, connecting to the bosh server requires encrypted communication. Regrettably, node-xmpp-bosh does not support SSL/TLS.

Inquiry

Is there a way to redirect the traffic to enable SSL/TLS connection? Or do I need to find an alternative bosh server to accommodate my needs?

Answer №1

After a few hours...feeling joyful once again :)

I've found the solution to my issue by routing the traffic to the bosh server through a proxy. Currently, I'm using this VirtualHost configuration on Apache:

<VirtualHost *:443>
    ServerName bosh.domain.tld
    ServerAlias www.bosh.domain.tld

    ServerAdmin <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c7a6a3aaaea987a3a8aaa6aea9e9b3aba3">[email protected]</a>

    <Proxy *>
        Order allow,deny
        Allow from all
    </Proxy>

    ProxyPass / http://127.0.0.1:5280/http-bind/
    ProxyPassReverse / http://127.0.0.1:5280/http-bind/


    SSLEngine on
    SSLCertificateFile /etc/letsencrypt/live/domain.tld/cert.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/domain.tld/privkey.pem
    SSLCertificateChainFile /etc/letsencrypt/live/domain.tld/chain.pem
    SSLVerifyClient None
    # HSTS (mod_headers is required) (15768000 seconds = 6 months)
    Header always set Strict-Transport-Security "max-age=15768000"
</VirtualHost>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

When setting up Vue.js for unit testing, the default installation may show a message stating that

Recently set up a fresh Vue project on Windows 7 using the VueJS UI utility. Unit testing with Jest enabled and added babel to the mix. However, when running "npm test" in the command line, an error is returned stating 'Error: no test specified' ...

Populating a many-to-many relationship in Mongoose using uni-directional references

These are the schemas I'm using to represent a many-to-many relationship: var GenreSchema = new Schema({ name: {type: String}, }); mongoose.model('Genre', GenreSchema); var MovieSchema = new Schema({ title: {type: String}, genres ...

Signs that indicate a socket has truly disconnected

socket.on('disconnect') isn't behaving as I anticipated. I want to be able to track when a user leaves my website completely, not just switches pages. Currently, navigating to a different route on my webpage triggers the socket disconnect ev ...

Connect individuals based on specific criteria within a nested array

My MongoDB collection looks something like this: _id: ObjectId("5cb089e459552d8b8cc6a9e4") username: "admin" password: "12345" gender: "male" interestedIn: "female" movie: Array 0: Object id: "Avatar" title: "Avatar" poster: "~" 1: Object ...

Receiving a blank array upon calling res.json() in Node.js script

I'm facing an issue with my code snippet that displays all posts, including the username and display picture of each user. Everything seems to be working fine as the log output is perfect. However, I'm struggling to return this data as a JSON obj ...

The issue with Mongoose not saving the modified document persists

Recently delving into Node.js, I embarked on creating a simple blog using Express, MongoDB, and Mongoose to manage post creation, editing, and deletion. While everything is running smoothly, there's an issue with the edit functionality. Below are my r ...

Upon refreshing the page, Node.js Express throws a 404 error

I recently deployed my project (built with NodeJS, Express, and ReactJs) to a Windows machine on AWS. Everything works smoothly when I access the website using the specific path like demo.co.il. However, when I try to access something like demo.co.il/login ...

communication between flutter and nodejs may encounter issues receiving requests

having trouble finding a solution from my code where I attempted to send data from Flutter to express.js this is my Flutter code: try{ var regbody={ "username":username, "fullname":fullname, "password":p ...

Exploring the find method within a Mongoose Schema for an array of objects

My Node Application has the following Mongoose Schema var expenseSchema = new Schema({ particular : String, date : {type : Date, default: Date.now}, paid_by : String, amount : Number, month : String }); var roomSchema = new Schema({ ...

Solving required packages in Express server

I am encountering difficulties with resolving dependencies on my express server. Below is the structure of my project: Calculator --dist ----app -------calculator.js -------server.js --node_modules --src ----app --------calculator.js --------server.js -- ...

Reports of missing packages in the React Starter Kit have caused confusion among users

While I may be new to React/JS, I have a wide range of experience in different technologies, including some work with Angular/JS. Therefore, my encounter with the Node/JS ecosystem is not completely fresh. The journey began when I encountered a missing pe ...

Node.js Namespacing Explained

Having some difficulty leveraging Node's module/require()/exports setup for proper object-oriented programming. Is it acceptable to create a global namespace and avoid using exports (similar to client-side JS development)? For example, in the module f ...

Error message: Unable to modify the 'cflags' property of object '#<Object>' in Angular CLI and node-gyp

@angular/cli has a dependency on node-gyp, which is evident from the following: npm ls node-gyp <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="16776666653b7477757d7970707f7573562738263826">[email protected]</a> /h ...

Sorry, the server cannot be reached at the moment. Please try again later

Recently delving into Node.js and just getting started on using MongoDB. Currently establishing a connection with my MongoDB Cluster that I have set up. const dbURI = 'mongodb+srv://testuser:<a href="/cdn-cgi/l/email-protection" class="__cf_email_ ...

Encountering a Mongoose Server Selection Error ECONNREFUSED while using a docker-compose file

My goal is to set up a sleek dockerized Mongo Express React Node stack. While Mongoose connects smoothly to my dockerized mongo when using node, it runs into issues inside docker. back.js : const express = require('express'); const app = expres ...

Download files using ajax in express framework

Is there a way to initiate file download in response to an ajax post request without actually downloading the file? $(function(){ $('img.download').click(function() { var image_path = $(this).attr('class').split(" ")[1] $.aja ...

Failed to build module: Unable to locate preset "stage-0" within the specified directory

When attempting to utilize a specific dependency, I encounter an error that only occurs with this particular dependency. Here is the error message: Module build failed: Error: Couldn't find preset "stage-0" relative to directory The import statemen ...

Guide on implementing ES6 script's template literals

I've been tackling a template literal question on hackerrank. It's working smoothly on my local IDE, but encountering an error on the Hackerrank IDE. Here's the code to add two numbers and print the result using a template literal: const sum ...

Establishing a server-side connection with Socket.io using Node.js

In my Node.js application, I have a frontend app and a backend app. The backend is responsible for managing the list and pushing updates to the frontend app. When I make a call to the frontend app, it triggers a list update so that all clients receive th ...

MongoDB Driver Alert: MongoError - Cursor Not Found. Cursor ID 7820213409290816 was not located in the specified namespace db_name.collection_name

Having successfully created a Nodejs API server that connects to AWS MongoDB (version: 3.6), everything seems to function flawlessly when calling one specific API endpoint (api/lowest). However, upon making multiple simultaneous calls to this API (15 in to ...