mirror of
				https://gitea.invidious.io/iv-org/shard-kemal.git
				synced 2024-08-15 00:53:36 +00:00 
			
		
		
		
	Add websocket_server sample
This commit is contained in:
		
							parent
							
								
									c005bae101
								
							
						
					
					
						commit
						5fa399de2c
					
				
					 1 changed files with 9 additions and 0 deletions
				
			
		
							
								
								
									
										9
									
								
								samples/websocket_server.cr
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								samples/websocket_server.cr
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,9 @@ | ||||||
|  | require "kemal" | ||||||
|  | 
 | ||||||
|  | ws "/" do |socket| | ||||||
|  |   socket.send "Hello from Kemal!" | ||||||
|  | 
 | ||||||
|  |   socket.on_message do |message| | ||||||
|  |     socket.send "Echo back from server #{message}" | ||||||
|  |   end | ||||||
|  | end | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue