update
This commit is contained in:
@@ -34,9 +34,20 @@ export default function Home() {
|
|||||||
if (connect) {
|
if (connect) {
|
||||||
console.log('Connected to proxy server');
|
console.log('Connected to proxy server');
|
||||||
remoteApp.listenProxy();
|
remoteApp.listenProxy();
|
||||||
remoteApp.emitter.on('message', (event) => {
|
remoteApp.on('message', (event) => {
|
||||||
const _msg = event.toString();
|
const _msg = event.toString();
|
||||||
console.log('Received message from remote app:', _msg);
|
console.log('Received message from remote app:', _msg);
|
||||||
|
const remote = document.querySelector('#remote')
|
||||||
|
if (remote) {
|
||||||
|
remote.innerHTML += `\n${_msg}`;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
remoteApp.on('open', () => {
|
||||||
|
console.log('Connection to remote app opened');
|
||||||
|
remoteApp.listenProxy()
|
||||||
|
});
|
||||||
|
remoteApp.on('close', () => {
|
||||||
|
console.log('Connection to remote app closed');
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
console.log('Not connected to proxy server');
|
console.log('Not connected to proxy server');
|
||||||
@@ -45,7 +56,7 @@ export default function Home() {
|
|||||||
return (
|
return (
|
||||||
<div className="flex min-h-screen items-center justify-center bg-zinc-50 font-sans dark:bg-black">
|
<div className="flex min-h-screen items-center justify-center bg-zinc-50 font-sans dark:bg-black">
|
||||||
<LayoutMain>
|
<LayoutMain>
|
||||||
|
<div id="remote"></div>
|
||||||
</LayoutMain>
|
</LayoutMain>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user