• Home
  • Categories
  • Recent
  • Popular
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development
Skins
  • Light
  • Default
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Quartz
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Slate
  • Solar
  • Superhero
  • Vapor
Collapse

Community

Reinier PupoR

Reinier Pupo

@Reinier Pupo
About
Posts
4
Topics
2
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

    RE: How to use websocket notifications from external app?
  • Reinier PupoR Reinier Pupo

    @pitaj Making a deep testing to connect my app to nodebb websocket, I realize that I have an error. I run this command in wscat:
    wscat -c ws://forum.example.com/socket.io
    and this is the response:
    error: Unexpected server response: 502
    The nginx config is:

    server {
        listen 80;
    
        server_name forum.example.com;
    
        location / {
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
            proxy_set_header Host $http_host;
            proxy_set_header X-NginX-Proxy true;
    
            proxy_pass http://127.0.0.1:4567;
            proxy_redirect off;
    
            # Socket.IO Support
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
        }
    }
    

    The nodeBB config.json:

    {
        "url": "http://forum.example.com",
        "secret": "&//&%$$",
        "database": "mongo",
        "mongo": {
            "host": "127.0.0.1",
            "port": "27017",
            "username": "nodebb",
            "password": "MyPass",
            "database": "nodebb",
            "uri": ""
        },
        "port": "4567",
        "socket.io": {
    	"origins": ["*:*"],
    	"transports": ["polling","websocket"]
        }
    }
    

    Is correct the ws://forum.example.com/socket.io
    address?
    Is this the correct workaround to connect through ws to nodeBB?


  • RE: How to use websocket notifications from external app?
  • Reinier PupoR Reinier Pupo

    @pitaj What I want is to listen for notifications, for example: new topic, new post, etc. I realize how to connect, but how can I listen for specifics events? For example:

    const socket = socketIOClient("ws://forum.example.com/socket.io");
    socket.on("event:new_topic", data => {
    console.log("Response: ", data.someValue)
    });


  • How to use websocket notifications from external app?
  • Reinier PupoR Reinier Pupo

    I want to integrate nodeBB to my web app as community forum. Do NodeBB websockets infraestucture allows my external app to listen for events like new topic, category, etc through socket.io channels? If it is possible, there is any example?

  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Home
  • Categories
  • Recent
  • Popular
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development
  • Login

  • Don't have an account? Register

  • Login or register to search.