# Use Synfig in a Web Browser with Broadway!

**URL:** https://forums.synfig.org/t/use-synfig-in-a-web-browser-with-broadway/13180
**Category:** Packaging
**Tags:** tablet, broadway, browser, phone
**Created:** [April 25, 2022, 4:09pm UTC](https://forums.synfig.org/t/use-synfig-in-a-web-browser-with-broadway/13180 "2022-04-25T16:09:03Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![BobSynfig](https://forums.synfig.org/user_avatar/forums.synfig.org/bobsynfig/32/175_2.png) [@BobSynfig](https://forums.synfig.org/u/BobSynfig)
#### Post date: [April 25, 2022, 4:09pm UTC](https://forums.synfig.org/t/use-synfig-in-a-web-browser-with-broadway/13180/1 "2022-04-25T16:09:03Z")

</div>

Today I wanted to try Broadway for the fun.  
This is a display server packaged with GTK allowing display of a GTK app in a Web Browser.

I was remembering some [topics](https://forums.synfig.org/t/iam-running-synfig-on-my-phone/12706/4) about JS or Android versions, and I was proposing RDP/VNC alternative.

But there is a more simple solution.  
Sadely yet I didn’t find a way to use directly AppImage binary (neither by extraction), so you would have to compile Synfig yourself and make reference to that build on the following script.

For example, I can reach it at `http://192.168.0.21:3131` with a tablet and a Bluetooth mouse.  
Have fun!

[Gist](https://gist.github.com/BobSynfig/603eb64d16515e610489a81cbce56a06)

```auto
#!/bin/bash
# Access SynfigStudio from your web browser at the address http://IP:PORT
# You can use for example a Tablet with a BlueTooth mouse
# Note: You may have to open the port in your firewall to access it from another device

IP=192.168.0.21 # The Ip of your interface
PORT=3131 # The Port
B_DISPLAY=:5 # A display number, 5 should be fine

# You can select a theme or let it empty for the default theme
# THEME=
# THEME=Adwaita:dark
THEME=Adwaita

# The path and name of your SynfigStudio build
BUILD_BASE=~/sources/synfig/_production/build # Depends on your system
BINARY=bin/synfigstudio # This should be untouched

# Don't modify below -------------------------------------------------
RUN_BROADWAYD="broadwayd --address=$IP --port=$PORT $B_DISPLAY"

# Start Broadway server
$RUN_BROADWAYD & </dev/null >/dev/null 2>&1
PID_BROADWAYD=$!

PWD=`pwd`
cd $BUILD_BASE
  GDK_BACKEND=broadway BROADWAY_DISPLAY=$B_DISPLAY GTK_THEME=$THEME $BINARY
cd $PWD

# Kill Broadway server
if ps -p $PID_BROADWAYD >/dev/null
then
  kill $PID_BROADWAYD >/dev/null || true
fi

```

**Edit: Added GTK THEME selection and modified for \_production**

---

<div class="post-metadata">

### Author: ![KonstantinDmitriev](https://forums.synfig.org/user_avatar/forums.synfig.org/konstantindmitriev/32/3_2.png) [@KonstantinDmitriev](https://forums.synfig.org/u/KonstantinDmitriev)
#### Post date: [April 26, 2022, 2:00pm UTC](https://forums.synfig.org/t/use-synfig-in-a-web-browser-with-broadway/13180/2 "2022-04-26T14:00:20Z")

</div>

Woah! This is so cool!

I suggest to replace

```auto
BUILD_BASE=~/sources/synfig/_debug/build

```

to

```auto
BUILD_BASE=~/sources/synfig/_production/build

```

to encourage users use non-debug builds (as they are faster). 😉
