How to run on host other than localhost
Hello,
I'm trying to test the application but my docker host is remote. I've set the env file and connect successfully to the software but i couldn't authenticate because of the erro below:
`sim:dev: 2025-05-12T14:02:18.443Z ERROR [Better Auth]: Invalid origin: http://123.123.123.123:3000
sim:dev: 2025-05-12T14:02:18.444Z INFO [Better Auth]: If it's a valid URL, please add http://123.123.123.123:3000 to trustedOrigins in your auth config
sim:dev: Current list of trustedOrigins: http://localhost:3000`
I couldn't find a way to add my ip address to auth config.
How can i do this?
Thank you
@umutbesler try adding your origin to the trustedOrigin in apps/sim/lib/auth.ts like this
export const auth = betterAuth({
database: drizzleAdapter(db, {
provider: 'pg',
schema,
}),
trustedOrigins: ['http://123.123.123.123:3000'],
session: {
cookieCache: {
enabled: true,
maxAge: 24 * 60 * 60, // 24 hours in seconds
},
Hello,
Thank you the issue is fixed and i can login the app now. But now there is another problem. Because i run this app on an ip address, the system gives the error "crypto.randomUUID is not a function".
As stated in the issue https://github.com/simstudioai/sim/issues/128#issuecomment-2769281981, we will need to configure HTTPS, but I couldn't find any information on how this system is supposed to operate over HTTPS. How can we do this?
@umutbesler when I'm running locally, i typically run ngrok. You run npm run dev and then in a separate terminal tab, you can run ngrok http {PORT} so if you are running on port 4000, you run ngrok http 4000.
The only thing to keep in mind is that you must also change your NEXT_PUBLIC_APP_URL and BETTER_AUTH_URL to this ngrok url as well.
I installed simstudio on a MacBook system at 192.168.40.9 using Docker. It runs without any problems on the same system, but when I try to run it in a browser on another computer on the network, it gives the same error: TypeError: crypto.randomUUID is not a function. I made the changes mentioned in the posts above, but I still get the same error on the client side. Of course, I think I would be grateful if you could help me.