How to access Babylon.js Editor live preview from other devices

Hi @julien-moreau

I’m trying to develop XR contents on Babylon.js Editor v4 beta8, but other devices can not access “http://:1338”. Of course my PC working BJS editor can access “http://localhost:1338”.

I modified webpack.config.js in my editor project like this.

module.exports = (_, argv) => {
	mode: 'development';//added by limes
//...
		// added by limes
		devserver:{
			host: '0.0.0.0' 
		},
		//...

I also tried “host 0.0.0.0” option in package.json like this.

    "scripts": {
        "clean": "rimraf build && rimraf declaration",
        "compile": "tsc -p .",
        "build": "webpack --mode production --host 0.0.0.0",
        "watch": "webpack --mode development --watch --host 0.0.0.0",
        "webserver": "http-server -p 1338 -c-1  --host 0.0.0.0"
    },

But nothing resolved.

Could you tell me the way to allowing access from other devices?

Thanks for your everyday help.

your webserver script should at least resolve else you might either have a firewall or router issue at home not allowing 1338 ???

1 Like

@sebavan

Thanks for your reply. I tried the following two patten.

(1)
I developed a simple environment without Babylon.js Editor in the same network as the above post. The environment has webpack.config.js like this.

const path = require('path');
const outputPath = path.resolve(__dirname, './');
module.exports = {
    
    entry: './src/index.js',
    output: {
        filename: 'main.js',
        path: outputPath
    },
    devServer: {
        contentBase: outputPath,
        watchContentBase: true,
        port: 3000,
        host:'0.0.0.0'
    }
}

I executed the command “npx webpack-dev-server” and my iPhone and android can access “http://‘my pc IP’:3000”.

(2)
I also tried to separate part of my Babylon.js Editor project “index.html”, “scenes folder”, and “dist folder” according to the post. The network is the same as the above post.

I used “Live Server” of Visual Studio Code for the separated project. My iPhone and android can also access “http://‘my pc IP’:5500”. (“5500” is the default port setting of Live Server.)

Hey @Limes2018!!
I reproduced, I can’t access the server elsewhere than on my pc itself. I don’t know why but I’m fixing ASAP :slight_smile:

Thanks for reporting!

2 Likes

Hi @julien-moreau !

Thanks for your replay and fixing the issue. I’ll appreciate it!

@Limes2018 still can’t figure out the problem :frowning:
But I’m on it!

Thanks for keeping your try!!

I’m trying to make a sample code including WebXR on Bablon.js Editor.
It takes more time because recently I don’t have enough time to do.

I’ll share blog post or sample code if my try has completed!

@Limes2018 Finally found!!!
I just pushed on release/4.0.0 :slight_smile:

2 Likes