46 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			HTML
		
	
	
	
			
		
		
	
	
			46 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			HTML
		
	
	
	
<!DOCTYPE html>
 | 
						|
<html lang="en">
 | 
						|
<head>
 | 
						|
    <meta charset="UTF-8">
 | 
						|
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
 | 
						|
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
 | 
						|
    <title>Document</title>
 | 
						|
</head>
 | 
						|
<body>
 | 
						|
    <script src="./script/index.js"></script>
 | 
						|
    <script>
 | 
						|
        var wsjs, iroom;
 | 
						|
        async function main(){
 | 
						|
            wsjs = new MWSE({
 | 
						|
                endpoint: "ws://localhost:7707"
 | 
						|
            });
 | 
						|
            wsjs.scope(async ()=>{
 | 
						|
                let me = wsjs.peer('me');
 | 
						|
                me.disablePairAuth();
 | 
						|
                console.log(me.socketId);
 | 
						|
                let room = wsjs.room({
 | 
						|
                    accessType: "public",
 | 
						|
                    description: "Benim odam",
 | 
						|
                    joinType: "free",
 | 
						|
                    name: "M.E.",
 | 
						|
                    notifyActionInvite: true,
 | 
						|
                    notifyActionJoined: true,
 | 
						|
                    notifyActionEjected: false,
 | 
						|
                    ifexistsJoin: true
 | 
						|
                });
 | 
						|
                await room.createRoom();
 | 
						|
                room.on('message',(...args)=>{
 | 
						|
                    console.log(args)
 | 
						|
                });
 | 
						|
                iroom = room;
 | 
						|
            });
 | 
						|
            wsjs.on('peer',(peer)=>{
 | 
						|
                peer.on('message',(...args)=>{
 | 
						|
                    console.log(args);
 | 
						|
                })
 | 
						|
            })
 | 
						|
        };
 | 
						|
        main();
 | 
						|
    </script>
 | 
						|
</body>
 | 
						|
</html> |