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

  • Default (No Skin)
  • No Skin
Collapse
v3.5.2 Latest
Buy Hosting

Where can I change the websocket port

Scheduled Pinned Locked Moved NodeBB Development
8 Posts 6 Posters 9.3k Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mnv2k2
    wrote on last edited by
    #1

    I'm checking nodebb v0.4.1 and I can't find where I can specify the websocket port it will connect. Please help.

    trevorT 1 Reply Last reply
    0
  • trevorT Offline
    trevorT Offline
    trevor Plugin & Theme Dev Anime Lovers GNU/Linux
    replied to mnv2k2 on last edited by trevor
    #2

    @mnv2k2 You can change the websocket port in the config.json file, which automatically generated in the root of where NodeBB is installed on your server. For example if you installed NodeBB in /home/example/nodebb/* the config.json file will be located there.

    Here's what this file contains for example:

    {
        "base_url": "http://example.com",
        "port": "8080", 
        "use_port": false,
        "secret": "",
        "bind_address": "0.0.0.0",
        "database": "redis",
        "redis": {
            "host": "127.0.0.1",
            "port": "6379",
            "password": "",
            "database": "0"
        },
        "bcrypt_rounds": 12,
        "upload_path": "/public/uploads",
        "relative_path": ""
    }
    

    8080 would be the port you would use to access your site.

    M 1 Reply Last reply
    0
  • M Offline
    M Offline
    mnv2k2
    replied to trevor on last edited by
    #3

    @trevor Hi trevor, thanks for the quick reply. The problem with this is that my http port is different from my websocket port. My understanding is that the "port" in config.json is for http port (which happens to be also used by websocket? I'm guessing here). Is it possible to use a different websocket port?

    1 Reply Last reply
    0
  • trevorT Offline
    trevorT Offline
    trevor Plugin & Theme Dev Anime Lovers GNU/Linux
    wrote on last edited by trevor
    #4

    Well depending on if you're using some type of front end web server such as nginx as a proxy to NodeBB or if another application is using port 80.

    If nginx is using port 80, then you will have to use change the nginx configuration as so: https://github.com/designcreateplay/NodeBB/wiki/Configuring-nginx-as-a-proxy-to-NodeBB

    If you are not using a web server such as nginx, you can go ahead and change whatever number that is to port 80 and it should run just fine without nginx. So if NodeBB is running on its default port of 4567, you can change this to 80.

    Let me know if this helps!

    1 Reply Last reply
    0
  • julianJ Offline
    julianJ Offline
    julian GNU/Linux
    wrote on last edited by
    #5

    Our setup of socket.io has it using the same port that NodeBB serves on, just for convenience purposes. We haven't ever had a request to serve websockets on a separate port -- what benefit is there? (Honestly wondering)

    1 Reply Last reply
    0
  • sub-lunarS Offline
    sub-lunarS Offline
    sub-lunar
    wrote on last edited by sub-lunar
    #6

    Sorry for digging up an old thread, but for me, there would be a real benefit from having the websocket running on a different port.

    I run nodebb on shared hosting at uberspace.de, using Apache with Pound as a reverse proxy. Neither Apache nor Pound support websockets, so I’m stuck with the ajax fallback. This has become a real problem since in v0.6.1, the menu for category permissions in the admin panel works with websockets only. So I had the guys at uberspace open a port on the machine for me and installed the ssl certificate in nodebb. Now I can access my installation with websockets and everything, but have to use the port number in the url, which is rather ugly. Also, this breaks the non-websocket version without the port number, because in that case, Pound does the ssl for me, but now node tries to do it, too, because it detects the https in the request url …

    The ideal configuration for me, thus, would be to run the socket.io-portion of nodebb as an entirely different application on its own port with its own ssl configuration and so on. The web app would be served through the reverse proxy for nice urls and the browser would then talk to the socket.io-app running on its own port, bypassing Apache and Pound.

    1 Reply Last reply
    1
  • spicewieselS Offline
    spicewieselS Offline
    spicewiesel
    wrote on last edited by spicewiesel
    #7

    I am stuck with the same problem and I am on uberspace, too. You can set up a socket.io address in the config.json, but I did not yet find the correct setup to get it to work with https

    S 1 Reply Last reply
    0
  • S Offline
    S Offline
    suparomana
    replied to spicewiesel on last edited by
    #8

    @spicewiesel I have the same problem with https on uberspace, too. Did you found a solution for this issue? Here is my thread on this 😉 https://community.nodebb.org/topic/10719/websocket-connection-problems-via-ssl-on-special-port

    1 Reply Last reply
    0

Copyright © 2023 NodeBB | Contributors
  • Login

  • Don't have an account? Register

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