How to receive NodeBB server notification from external web socket client

NodeBB Development

Suggested Topics


  • NodeBb Integration With WordPress

    Unsolved NodeBB Development
    3
    1 Votes
    3 Posts
    2k Views

    I would like that too. But specifically add the NodeBB forum inside a wordpress page via template.

    EDIT: a plugin similar to that would be a good start -> https://wordpress.org/plugins/wp-discourse/

  • 7 Votes
    25 Posts
    18k Views

    Didn't notice this - but I signed!

  • 0 Votes
    10 Posts
    2k Views

    @baris said:

    We had no reports of anyone altering socket.uid its a server side only value.

    A while back there was a certain vulnerability (not NodeBB specific), I don't exactly remember what it was, but it allowed a user to mimic another user, even an admin, and do pretty much everything as that user.

    Now you have one report 😉

  • 1 Votes
    4 Posts
    2k Views

    To get back on this, I have currently solved it in the following way:
    ###/lib/nodebb.js:

    module.exports = { "Meta": module.parent.parent.require('./meta'), "User": module.parent.parent.require('./user'), "Plugins": module.parent.parent.require('./plugins'), "SocketIndex": module.parent.parent.require('./socket.io/index'), "ModulesSockets": module.parent.parent.require('./socket.io/modules'), "db": module.parent.parent.require('./database') }

    ###library.js:

    var NodeBB = require('./lib/nodebb');

    ###/lib/submoduleX.js:

    var NodeBB = module.require('./nodebb'), db = NodeBB.db, User = NodeBB.User, Plugins = NodeBB.Plugins;

    ##Why this works
    I read somewhere that require caches the files you load. That means that if require my nodebb.js from library.js, I can later load nodebb.js from any submodule I want and it will work.

  • 0 Votes
    8 Posts
    2k Views

    @baris sounds good. Thank you!