How to use custom port for game preview server?

Actually, cocos uses 7456 as default port for your game preview server, and you can put it in your browser, with your IP:7456 to run the game, now I don’t link 7456, instead I want to put any other number, what to do for that, Please step-forward and answer, I couldn’t find any solution.

1 Like

It’s been two weeks, I still can’t find any solution. Or am I posting in wrong forum?

you can use https://www.npmjs.com/package/http-server instead, but that would only work for the build directory.

There is no way actually, using http-server is not recommended as there will be two servers, hmmm, i think cocos dev team will add this configurable preference prior to their upcoming updates.

The only thing i know is that if you have a project opened and you open another one, the second one will use 7457 instead, so you can preview two or more projects at the same time. That’ss enough for me, why would you want to change the port?

U r right, typing 7456 in my phone drives me crazy… LEL

Well, you can always use the bidi/qr, but i prefer to write it hahaha

1 Like

How did I miss it, Thank you

1 Like