<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de">
		<id>https://siprtc.azurewebsites.net/index.php?action=history&amp;feed=atom&amp;title=Biliothek%3Aws</id>
		<title>Biliothek:ws - Versionsgeschichte</title>
		<link rel="self" type="application/atom+xml" href="https://siprtc.azurewebsites.net/index.php?action=history&amp;feed=atom&amp;title=Biliothek%3Aws"/>
		<link rel="alternate" type="text/html" href="https://siprtc.azurewebsites.net/index.php?title=Biliothek:ws&amp;action=history"/>
		<updated>2026-05-06T14:34:11Z</updated>
		<subtitle>Versionsgeschichte dieser Seite in sipRTC</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>https://siprtc.azurewebsites.net/index.php?title=Biliothek:ws&amp;diff=26&amp;oldid=prev</id>
		<title>Admin: Die Seite wurde neu angelegt: „Category:Bibliothek == Server ==  (Teilweise übernommen aus [https://github.com/websockets/ws])  === Server bereitstellen ===  &lt;syntaxhighlight lang=&quot;Java…“</title>
		<link rel="alternate" type="text/html" href="https://siprtc.azurewebsites.net/index.php?title=Biliothek:ws&amp;diff=26&amp;oldid=prev"/>
				<updated>2018-03-06T21:25:59Z</updated>
		
		<summary type="html">&lt;p&gt;Die Seite wurde neu angelegt: „&lt;a href=&quot;/index.php?title=Kategorie:Bibliothek&quot; title=&quot;Kategorie:Bibliothek&quot;&gt;Category:Bibliothek&lt;/a&gt; == Server ==  (Teilweise übernommen aus [https://github.com/websockets/ws])  === Server bereitstellen ===  &amp;lt;syntaxhighlight lang=&amp;quot;Java…“&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Neue Seite&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Category:Bibliothek]]&lt;br /&gt;
== Server ==&lt;br /&gt;
&lt;br /&gt;
(Teilweise übernommen aus [https://github.com/websockets/ws])&lt;br /&gt;
&lt;br /&gt;
=== Server bereitstellen ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;JavaScript&amp;quot; line&amp;gt;&lt;br /&gt;
var WebSocketServer = require('ws').Server&lt;br /&gt;
  , wss = new WebSocketServer({ port: 8080 });&lt;br /&gt;
&lt;br /&gt;
wss.on('connection', function connection(ws) {&lt;br /&gt;
  ws.on('message', function incoming(message) {&lt;br /&gt;
    console.log('received: %s', message);&lt;br /&gt;
  });&lt;br /&gt;
&lt;br /&gt;
  ws.send('something');&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sending and receiving text data ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;JavaScript&amp;quot; line&amp;gt;&lt;br /&gt;
var WebSocket = require('ws');&lt;br /&gt;
var ws = new WebSocket('ws://www.host.com/path');&lt;br /&gt;
&lt;br /&gt;
ws.on('open', function open() {&lt;br /&gt;
  ws.send('something');&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
ws.on('message', function(data, flags) {&lt;br /&gt;
  // flags.binary will be set if a binary data is received.&lt;br /&gt;
  // flags.masked will be set if the data was masked.&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Server sending broadcast data ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;JavaScript&amp;quot; line&amp;gt;&lt;br /&gt;
var WebSocketServer = require('ws').Server&lt;br /&gt;
  , wss = new WebSocketServer({ port: 8080 });&lt;br /&gt;
&lt;br /&gt;
// Broadcast to all.&lt;br /&gt;
wss.broadcast = function broadcast(data) {&lt;br /&gt;
  wss.clients.forEach(function each(client) {&lt;br /&gt;
    client.send(data);&lt;br /&gt;
  });&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
wss.on('connection', function connection(ws) {&lt;br /&gt;
  ws.on('message', function message(data) {&lt;br /&gt;
    // Broadcast to everyone except message sending socket&lt;br /&gt;
    wss.clients.forEach(function each(client) {&lt;br /&gt;
      if (client !== ws) client.send(data);&lt;br /&gt;
    });&lt;br /&gt;
  });&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Weblinks ==&lt;br /&gt;
* [https://github.com/websockets/ws GitHub]&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>