245 lines
		
	
	
		
			9.8 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			245 lines
		
	
	
		
			9.8 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">
 | |
|         
 | |
|         
 | |
|         
 | |
|         <link rel="shortcut icon" href="../img/favicon.ico">
 | |
|         <title>Ws - IXWebSocket</title>
 | |
|         <link href="../css/bootstrap-custom.min.css" rel="stylesheet">
 | |
|         <link href="../css/font-awesome.min.css" rel="stylesheet">
 | |
|         <link href="../css/base.css" rel="stylesheet">
 | |
|         <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/github.min.css">
 | |
|         <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
 | |
|         <!--[if lt IE 9]>
 | |
|             <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
 | |
|             <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
 | |
|         <![endif]-->
 | |
| 
 | |
|         <script src="../js/jquery-1.10.2.min.js" defer></script>
 | |
|         <script src="../js/bootstrap-3.0.3.min.js" defer></script>
 | |
|         <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
 | |
|         <script>hljs.initHighlightingOnLoad();</script> 
 | |
|     </head>
 | |
| 
 | |
|     <body>
 | |
| 
 | |
|         <div class="navbar navbar-default navbar-fixed-top" role="navigation">
 | |
|             <div class="container">
 | |
| 
 | |
|                 <!-- Collapsed navigation -->
 | |
|                 <div class="navbar-header">
 | |
|                     <!-- Expander button -->
 | |
|                     <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
 | |
|                         <span class="sr-only">Toggle navigation</span>
 | |
|                         <span class="icon-bar"></span>
 | |
|                         <span class="icon-bar"></span>
 | |
|                         <span class="icon-bar"></span>
 | |
|                     </button>
 | |
|                     <a class="navbar-brand" href="..">IXWebSocket</a>
 | |
|                 </div>
 | |
| 
 | |
|                 <!-- Expanded navigation -->
 | |
|                 <div class="navbar-collapse collapse">
 | |
|                         <!-- Main navigation -->
 | |
|                         <ul class="nav navbar-nav">
 | |
|                             <li >
 | |
|                                 <a href="..">Home</a>
 | |
|                             </li>
 | |
|                             <li >
 | |
|                                 <a href="../CHANGELOG/">Changelog</a>
 | |
|                             </li>
 | |
|                             <li >
 | |
|                                 <a href="../build/">Build</a>
 | |
|                             </li>
 | |
|                             <li >
 | |
|                                 <a href="../design/">Design</a>
 | |
|                             </li>
 | |
|                             <li >
 | |
|                                 <a href="../usage/">Examples</a>
 | |
|                             </li>
 | |
|                             <li class="active">
 | |
|                                 <a href="./">Ws</a>
 | |
|                             </li>
 | |
|                         </ul>
 | |
| 
 | |
|                     <ul class="nav navbar-nav navbar-right">
 | |
|                         <li>
 | |
|                             <a href="#" data-toggle="modal" data-target="#mkdocs_search_modal">
 | |
|                                 <i class="fa fa-search"></i> Search
 | |
|                             </a>
 | |
|                         </li>
 | |
|                             <li >
 | |
|                                 <a rel="next" href="../usage/">
 | |
|                                     <i class="fa fa-arrow-left"></i> Previous
 | |
|                                 </a>
 | |
|                             </li>
 | |
|                             <li class="disabled">
 | |
|                                 <a rel="prev" >
 | |
|                                     Next <i class="fa fa-arrow-right"></i>
 | |
|                                 </a>
 | |
|                             </li>
 | |
|                     </ul>
 | |
|                 </div>
 | |
|             </div>
 | |
|         </div>
 | |
| 
 | |
|         <div class="container">
 | |
|                 <div class="col-md-3"><div class="bs-sidebar hidden-print affix well" role="complementary">
 | |
|     <ul class="nav bs-sidenav">
 | |
|         <li class="main active"><a href="#general">General</a></li>
 | |
|         <li class="main "><a href="#file-transfer">File transfer</a></li>
 | |
|         <li class="main "><a href="#http-client">HTTP Client</a></li>
 | |
|         <li class="main "><a href="#cobra-client">Cobra Client</a></li>
 | |
|     </ul>
 | |
| </div></div>
 | |
|                 <div class="col-md-9" role="main">
 | |
| 
 | |
| <h2 id="general">General</h2>
 | |
| <p>ws is a command line tool that should exercise most of the IXWebSocket code, and provide example code.</p>
 | |
| <pre><code>ws is a websocket tool
 | |
| Usage: ws [OPTIONS] SUBCOMMAND
 | |
| 
 | |
| Options:
 | |
|   -h,--help                   Print this help message and exit
 | |
| 
 | |
| Subcommands:
 | |
|   send                        Send a file
 | |
|   receive                     Receive a file
 | |
|   transfer                    Broadcasting server
 | |
|   connect                     Connect to a remote server
 | |
|   chat                        Group chat
 | |
|   echo_server                 Echo server
 | |
|   broadcast_server            Broadcasting server
 | |
|   ping                        Ping pong
 | |
|   curl                        HTTP Client
 | |
|   redis_publish               Redis publisher
 | |
|   redis_subscribe             Redis subscriber
 | |
|   cobra_subscribe             Cobra subscriber
 | |
|   cobra_publish               Cobra publisher
 | |
|   cobra_to_statsd             Cobra to statsd
 | |
|   cobra_to_sentry             Cobra to sentry
 | |
|   snake                       Snake server
 | |
|   httpd                       HTTP server
 | |
| </code></pre>
 | |
| 
 | |
| <h2 id="file-transfer">File transfer</h2>
 | |
| <pre><code># Start transfer server, which is just a broadcast server at this point
 | |
| ws transfer # running on port 8080.
 | |
| 
 | |
| # Start receiver first
 | |
| ws receive ws://localhost:8080
 | |
| 
 | |
| # Then send a file. File will be received and written to disk by the receiver process
 | |
| ws send ws://localhost:8080 /file/to/path
 | |
| </code></pre>
 | |
| 
 | |
| <h2 id="http-client">HTTP Client</h2>
 | |
| <pre><code>$ ws curl --help
 | |
| HTTP Client
 | |
| Usage: ws curl [OPTIONS] url
 | |
| 
 | |
| Positionals:
 | |
|   url TEXT REQUIRED           Connection url
 | |
| 
 | |
| Options:
 | |
|   -h,--help                   Print this help message and exit
 | |
|   -d TEXT                     Form data
 | |
|   -F TEXT                     Form data
 | |
|   -H TEXT                     Header
 | |
|   --output TEXT               Output file
 | |
|   -I                          Send a HEAD request
 | |
|   -L                          Follow redirects
 | |
|   --max-redirects INT         Max Redirects
 | |
|   -v                          Verbose
 | |
|   -O                          Save output to disk
 | |
|   --compress                  Enable gzip compression
 | |
|   --connect-timeout INT       Connection timeout
 | |
|   --transfer-timeout INT      Transfer timeout
 | |
| </code></pre>
 | |
| 
 | |
| <h2 id="cobra-client">Cobra Client</h2>
 | |
| <p><a href="https://github.com/machinezone/cobra">cobra</a> is a real time messenging server. ws has sub-command to interacti with cobra.</p></div>
 | |
|         </div>
 | |
| 
 | |
|         <footer class="col-md-12">
 | |
|             <hr>
 | |
|             <p>Documentation built with <a href="https://www.mkdocs.org/">MkDocs</a>.</p>
 | |
|         </footer>
 | |
|         <script>
 | |
|             var base_url = "..",
 | |
|                 shortcuts = {"help": 191, "next": 78, "previous": 80, "search": 83};
 | |
|         </script>
 | |
|         <script src="../js/base.js" defer></script>
 | |
|         <script src="../search/main.js" defer></script>
 | |
| 
 | |
|         <div class="modal" id="mkdocs_search_modal" tabindex="-1" role="dialog" aria-labelledby="Search Modal" aria-hidden="true">
 | |
|     <div class="modal-dialog">
 | |
|         <div class="modal-content">
 | |
|             <div class="modal-header">
 | |
|                 <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
 | |
|                 <h4 class="modal-title" id="exampleModalLabel">Search</h4>
 | |
|             </div>
 | |
|             <div class="modal-body">
 | |
|                 <p>
 | |
|                     From here you can search these documents. Enter
 | |
|                     your search terms below.
 | |
|                 </p>
 | |
|                 <form role="form">
 | |
|                     <div class="form-group">
 | |
|                         <input type="text" class="form-control" placeholder="Search..." id="mkdocs-search-query" title="Type search term here">
 | |
|                     </div>
 | |
|                 </form>
 | |
|                 <div id="mkdocs-search-results"></div>
 | |
|             </div>
 | |
|             <div class="modal-footer">
 | |
|             </div>
 | |
|         </div>
 | |
|     </div>
 | |
| </div><div class="modal" id="mkdocs_keyboard_modal" tabindex="-1" role="dialog" aria-labelledby="Keyboard Shortcuts Modal" aria-hidden="true">
 | |
|     <div class="modal-dialog">
 | |
|         <div class="modal-content">
 | |
|             <div class="modal-header">
 | |
|                 <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
 | |
|                 <h4 class="modal-title" id="exampleModalLabel">Keyboard Shortcuts</h4>
 | |
|             </div>
 | |
|             <div class="modal-body">
 | |
|               <table class="table">
 | |
|                 <thead>
 | |
|                   <tr>
 | |
|                     <th style="width: 20%;">Keys</th>
 | |
|                     <th>Action</th>
 | |
|                   </tr>
 | |
|                 </thead>
 | |
|                 <tbody>
 | |
|                   <tr>
 | |
|                     <td class="help shortcut"><kbd>?</kbd></td>
 | |
|                     <td>Open this help</td>
 | |
|                   </tr>
 | |
|                   <tr>
 | |
|                     <td class="next shortcut"><kbd>n</kbd></td>
 | |
|                     <td>Next page</td>
 | |
|                   </tr>
 | |
|                   <tr>
 | |
|                     <td class="prev shortcut"><kbd>p</kbd></td>
 | |
|                     <td>Previous page</td>
 | |
|                   </tr>
 | |
|                   <tr>
 | |
|                     <td class="search shortcut"><kbd>s</kbd></td>
 | |
|                     <td>Search</td>
 | |
|                   </tr>
 | |
|                 </tbody>
 | |
|               </table>
 | |
|             </div>
 | |
|             <div class="modal-footer">
 | |
|             </div>
 | |
|         </div>
 | |
|     </div>
 | |
| </div>
 | |
| 
 | |
|     </body>
 | |
| </html>
 |