{"id":175563,"date":"2013-04-06T01:08:03","date_gmt":"2013-04-05T21:08:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=175563"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=175563","title":{"rendered":"<span class=\"post_title\">\u041a\u0430\u043a \u0441\u043b\u0443\u0448\u0430\u0442\u044c \u0440\u0430\u0434\u0438\u043e \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c powershell \u0438 node.js<\/span>"},"content":{"rendered":"<div class=\"content html_format\">\n<h5>\u0427\u0430\u0441\u0442\u044c \u043f\u0435\u0440\u0432\u0430\u044f: <a href=\"http:\/\/ru.wikipedia.org\/wiki\/Windows_PowerShell\">powershell<\/a> \u0438 <a href=\"http:\/\/ru.wikipedia.org\/wiki\/MCI_(%D0%B8%D0%BD%D1%82%D0%B5%D1%80%D1%84%D0%B5%D0%B9%D1%81)\">mci<\/a>.<\/h5>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u2014 Windows 7.<br \/>  \u041f\u0435\u0440\u0432\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442: \u043a\u0430\u043a \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u0438 mp3 \u0432 powershell?<br \/>  \u0420\u0430\u043d\u0435\u0435 \u043d\u0430 \u0445\u0430\u0431\u0440\u0435 \u0431\u044b\u043b\u0438 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043d\u0438\u044f \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u0432\u043e\u043f\u0440\u043e\u0441\u0430:<br \/>  <a href=\"http:\/\/habrahabr.ru\/qa\/6717\/\">\u041a\u0430\u043a \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u0438 mp3 \u0438\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 Windows 7?<\/a><br \/>  <a href=\"http:\/\/habrahabr.ru\/post\/117441\/\">\u041a\u0430\u043a \u0436\u0435 \u0432\u0441\u0435-\u0442\u0430\u043a\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f PowerShell?<\/a><\/p>\n<p>  \u0412\u0432\u0438\u0434\u0443 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430, \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Media Control Interface \u0438\u043b\u0438 mci.<br \/>  \u041f\u043b\u044e\u0441\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435: \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u0430\u044f \u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u043e\u0441\u0442\u044c, \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0441\u044b\u043b\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432 \u0432\u0438\u0434\u0435 \u0441\u0442\u0440\u043e\u043a\u0438. <br \/>   \u041c\u043d\u043e\u0433\u0438\u043c mci \u0438\u0437\u0432\u0435\u0441\u0442\u0435\u043d \u043f\u043e \u043e\u0442\u0432\u0435\u0442\u0443 \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441: \u00ab\u043a\u0430\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e \u043e\u0442\u0440\u044b\u0442\u044c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u0447\u0442\u0435\u043d\u0438\u044f-\u0437\u0430\u043f\u0438\u0441\u0438 \u043a\u043e\u043c\u043f\u0430\u043a\u0442 \u0434\u0438\u0441\u043a\u043e\u0432?\u00bb, \u0445\u043e\u0442\u044f \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043c\u043d\u043e\u0433\u043e \u0434\u0440\u0443\u0433\u0438\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439. \u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p>  \u0418\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u0435 CD-ROM:  <\/p>\n<pre><code class=\"cs\">mci 'set cdaudio door open' <\/code><\/pre>\n<p>  \u0412\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e mp3-\u0444\u0430\u0439\u043b\u0430:  <\/p>\n<pre><code class=\"cs\">mci 'play C:\\\\temp\\\\Kalimba.mp3' mci 'status C:\\\\temp\\\\Kalimba.mp3 mode' <\/code><\/pre>\n<p>  \u0417\u0430\u043f\u0438\u0441\u044c \u0432 wav-\u0444\u0430\u0439\u043b:  <\/p>\n<pre><code class=\"cs\">mci 'open new type waveaudio alias RecWavFile' mci 'set RecWavFile bitspersample 16 samplespersec 44100 channels 2' mci 'record RecWavFile' mci 'stop RecWavFile' mci 'save RecWavFile C:\\\\temp\\\\RecWavFile.wav' mci 'close RecWavFile' mci 'play C:\\\\temp\\\\RecWavFile.wav wait' <\/code><\/pre>\n<p>  \u041f\u0440\u043e\u0441\u0442\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043f\u043e\u0442\u043e\u043a\u0430 \u0438\u0437 \u0441\u0435\u0442\u0438:  <\/p>\n<pre><code class=\"cs\">mci 'play http:\/\/some-radio-server.com:80\/some-radio-channel.mp3' <\/code><\/pre>\n<p>  <a name=\"habracut\"><\/a><br \/>  \u041f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043f\u043e\u0442\u043e\u043a\u0430 \u0438\u0437 \u0441\u0435\u0442\u0438:  <\/p>\n<pre><code class=\"cs\">mci 'open http:\/\/some-radio-server.com:80\/some-radio-channel.mp3 type mpegvideo alias radio' #mci 'open http:\/\/other-radio-server\/other-radio-channel.fake.mp3 type mpegvideo alias radio' mci 'status radio volume' mci 'setaudio radio volume to 100' mci 'play radio' mci 'status radio mode' mci 'stop radio' mci 'close radio' <\/code><\/pre>\n<p>  \u041c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u043c, \u043d\u043e \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0432 powershell \u043d\u0435\u0442 \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430(\u0430\u0432\u0442\u043e\u0440 \u043d\u0435 \u043d\u0430\u0448\u0435\u043b) \u0440\u0430\u0431\u043e\u0442\u044b \u0441 mci. \u0427\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u0443 \u0440\u0430\u0431\u043e\u0442\u0443 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0439, \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043e\u0431\u0435\u0440\u0442\u043a\u0443 \u043d\u0430\u0434 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 mciSendStringA. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0438\u043c\u0435\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439 command line interface, \u043f\u043e\u043c\u0438\u043c\u043e \u0432\u0432\u043e\u0434\u0430 \u043a\u043e\u043c\u0430\u043d\u0434, \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u044b\u0432\u043e\u0434 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u043a\u0430 \u043a\u043e\u0434\u043e\u0432 \u043e\u0448\u0438\u0431\u043e\u043a. \u041f\u0435\u0440\u0432\u043e\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 status. \u0412\u0442\u043e\u0440\u043e\u0435 \u0443\u0434\u043e\u0431\u043d\u043e, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0438\u0441\u043a\u0430\u0442\u044c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438. <\/p>\n<p>  <b>mci powershell wrapper:<\/b>  <\/p>\n<pre><code class=\"php\">$MemDef =@&quot; [DllImport(&quot;winmm.dll&quot;, CharSet = CharSet.Ansi)] public static extern int mciSendStringA( string lpstrCommand, [Out] byte[] lpstrReturnString, int uReturnLength, IntPtr hwndCallback);  [DllImport(&quot;winmm.dll&quot;, CharSet = CharSet.Ansi)] public static extern int mciGetErrorStringA( int dwError, [Out] byte[] lpstrBuffer, int uLength); &quot;@ $winmm = Add-Type -memberDefinition $MemDef -ErrorAction 'SilentlyContinue' -passthru -name mciSendString function mci($strSend) {     $buffer = New-Object byte[] 128     [int]$error = $winmm::mciSendStringA( $strSend, $buffer, 128, 0 )     [Text.Encoding]::ASCII.GetString($buffer)     $error_buffer = New-Object byte[] 128     [void]$winmm::mciGetErrorStringA( $error, $error_buffer, 128 )     [Text.Encoding]::GetEncoding('windows-1251').GetString($error_buffer) } <\/code><\/pre>\n<p>  \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c\u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u044f.<br \/>  \u0412\u043d\u0443\u0442\u0440\u0438 $MemDef \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u043a\u0443\u0441\u043e\u043a \u043a\u043e\u0434\u0430 \u043d\u0430 \u0421#. \u0410 \u0432\u043d\u0443\u0442\u0440\u0438 $winmm \u2014 \u0443\u0436\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0435\u0433\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438.<br \/>  \u0414\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u043d\u0443\u0436\u043d\u043e \u0438\u0437 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u0447\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438:  <\/p>\n<ol>\n<li>\u043e\u0431\u044a\u044f\u0432\u0438\u0442\u044c \u0442\u0438\u043f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438(\u0432 \u043a\u043e\u0434\u0435 \u043d\u0430 \u0421#, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442, \u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435) \u043a\u0430\u043a [Out] byte[];<\/li>\n<li>\u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c \u0431\u0443\u0444\u0435\u0440;<\/li>\n<li>\u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0431\u0443\u0444\u0435\u0440 \u0438 \u0440\u0430\u0437\u043c\u0435\u0440 \u0431\u0443\u0444\u0435\u0440\u0430;<\/li>\n<li>\u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0431\u0430\u0439\u0442\u044b \u043a\u0430\u043a \u0441\u0442\u0440\u043e\u043a\u0443 \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0435.<\/li>\n<\/ol>\n<p>  \u041c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 C#, \u0442\u0435\u043c \u0431\u043e\u043b\u0435\u0435 \u0434\u043b\u044f \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f winapi-\u0448\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u2014 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e. \u041d\u043e \u0442\u0443\u0442 \u0432\u0430\u0436\u043d\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f, \u0430 \u043d\u0435 \u0441\u043f\u043e\u0441\u043e\u0431 \u0435\u0433\u043e \u0434\u043e\u0441\u0442\u0438\u0436\u0435\u043d\u0438\u044f: \u0441\u0442\u0440\u043e\u043a\u0430 \u0441 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 mci \u0433\u0430\u0440\u043c\u043e\u043d\u0438\u0447\u043d\u043e \u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0441\u0442\u0438\u043b\u044c powershell.<\/p>\n<p>  \u0421\u043f\u0438\u0441\u043e\u043a mci \u043a\u043e\u043c\u0430\u043d\u0434 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/windows\/desktop\/dd743572(v=vs.85).aspx\">\u0442\u0443\u0442<\/a> \u0438\u043b\u0438 \u043f\u043e\u0438\u0441\u043a\u043e\u043c \u00abMultimedia Command Strings\u00bb.<br \/>  P.S. \u0427\u0435\u0440\u0435\u0437 mci \u043c\u043e\u0436\u043d\u043e \u0438 \u0444\u0438\u043b\u044c\u043c\u044b \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c.<\/p>\n<h5>\u0427\u0430\u0441\u0442\u044c \u0432\u0442\u043e\u0440\u0430\u044f: <a href=\"http:\/\/ru.wikipedia.org\/wiki\/HTTP\">http<\/a> <a href=\"http:\/\/ru.wikipedia.org\/wiki\/%D0%9F%D1%80%D0%BE%D0%BA%D1%81%D0%B8-%D1%81%D0%B5%D1%80%D0%B2%D0%B5%D1%80\">proxy<\/a> \u0438 <a href=\"http:\/\/ru.wikipedia.org\/wiki\/Nodejs\">node.js<\/a><\/h5>\n<p>  \u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u0438\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432: \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u043c\u0435\u043d\u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b, \u043d\u043e \u0438 URL.<br \/>  \u041d\u043e \u0434\u043b\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432(\u0442\u0430\u043a\u0438\u0445, \u043a\u0430\u043a other-radio-server) \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430: \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435 \u043f\u0440\u0438\u043d\u0443\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u0440\u044b\u0432\u0430 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f. \u0422\u0443\u0442 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043c\u043e\u0447\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 HTTP proxy \u00ab\u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0439\u00bb \u00ab\u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0435\u00bb \u043f\u0430\u043a\u0435\u0442\u044b. \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u0434\u043b\u044f \u043d\u0435\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0432 \u043e\u0442\u0432\u0435\u0442 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a &#8216;content-length&#8217;.<br \/>  \u0414\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0432\u043e\u0435\u0433\u043e \u043f\u0440\u043e\u043a\u0441\u0438 \u043b\u0443\u0447\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442 node.js.<\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u043a\u0441\u0438 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u0447\u043a\u0443 \u0432\u043c\u0435\u0441\u0442\u043e \u043f\u0440\u0435\u0434\u0448\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0435\u0439.<br \/>  \u041e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u0435 url &quot;.fake.mp3&quot; \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0439 \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u043f\u0440\u043e\u043a\u0441\u0438. \u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u0434\u0430\u043b\u0435\u043a\u0438\u0439 \u043e\u0442 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u0434 \u0441\u0435\u0440\u0432\u0435\u0440\u0430.<\/p>\n<p>  <b>node\/proxy_server.js:<\/b>  <\/p>\n<pre><code class=\"javascript\">require('.\/simple_cli').run() var http = require('http') var url = require('url')  http.createServer(function(request, response) {   var u = url.parse(request.url)   var options = {     port     : u['port'] || 80,     host     : u['hostname'],     method   : request.method,     path     : u['pathname'],     headers  : request.headers   }   console.log(request.url)   delete options.headers['proxy-connection']   if( request.url.substr(-9) === &quot;.fake.mp3&quot; )   {     var p = options['path']     options['path'] = p.substr(0, p.length - 9)     options['icy-metadata'] = '0'   }   console.log(options)   var proxy_request = http.request(options);   proxy_request.on('response', function (proxy_response) {     console.log(proxy_response.headers)     if( request.url.substr(-9) === &quot;.fake.mp3&quot; )     {       proxy_response.headers['content-length'] = '221183499'     }     proxy_response.pipe(response);     response.writeHead(proxy_response.statusCode, proxy_response.headers);   });   request.pipe(proxy_request); }).listen(8080);  console.log('Server running...'); <\/code><\/pre>\n<p>  P.S. \u041f\u0440\u043e\u043a\u0441\u0438 \u043c\u043e\u0436\u0435\u0442 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u044c\u0441\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \u0438\u043b\u0438 \u043f\u0440\u0435\u0434\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u043c\u044b\u0445 \u043e\u0442\u0432\u0435\u0442\u043e\u0432.<\/p>\n<h5>\u0427\u0430\u0441\u0442\u044c \u0442\u0440\u0435\u0442\u044c\u044f: <a href=\"http:\/\/ru.wikipedia.org\/wiki\/%D0%98%D0%BD%D1%82%D0%B5%D1%80%D0%B0%D0%BA%D1%82%D0%B8%D0%B2%D0%BD%D0%BE%D1%81%D1%82%D1%8C\">\u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c<\/a><\/h5>\n<p>  \u0418\u043d\u043e\u0433\u0434\u0430, \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u0432, \u043f\u0440\u043e\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0447\u0435\u0440\u0435\u0437 \u0441\u0435\u0440\u0432\u0435\u0440, \u043d\u0443\u0436\u043d\u043e \u043e\u0447\u0438\u0441\u0442\u0438\u0442\u044c \u043a\u043e\u043d\u0441\u043e\u043b\u044c. \u041f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f.<br \/>  <b>node\/simple_cli.js<\/b>  <\/p>\n<pre><code class=\"javascript\">module.exports.run = function(){   process.stdin.resume();   process.stdin.setEncoding('utf8');   process.stdin.on('data', function (data) {     data = data.toString().trim();     switch (data)     {     case 'exit':       process.exit();       break;     case 'clear':       process.stdout.write('\\u001B[2J\\u001B[0;0f');       break;     case 'help':       process.stdout.write('exit, clear, help\\n');       break;     default:       process.stdout.write('unrecognize: '+data+'\\n');     }   }); } <\/code><\/pre>\n<p>  \u042d\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430:<br \/>  <b>run_proxy_server.cmd<\/b>  <\/p>\n<pre><code class=\"dos\">&quot;%~d0%~p0node.exe&quot; &quot;%~d0%~p0node\\proxy_server.js&quot; pause <\/code><\/pre>\n<p>  \u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0440\u0435\u0446\u0435\u043f\u0442:  <\/p>\n<ol>\n<li> \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0432 \u0440\u0430\u0431\u043e\u0447\u0443\u044e \u043f\u0430\u043f\u043a\u0443 node.exe c \u00ab<a href=\"http:\/\/nodejs.org\/download\/\">nodejs.org\/download\/<\/a>\u00bb<br \/>   \u041f\u043e\u0441\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0432 \u043d\u0435\u0439 \u0432\u0441\u0435\u0445 \u0444\u0430\u0439\u043b\u043e\u0432, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0434\u0435\u0440\u0435\u0432\u043e:<br \/>   +<br \/>   |-node.exe<br \/>   |-run_proxy_server.cmd<br \/>   |+node<br \/>   | |-proxy_server.js<br \/>   | |-simple_cli.js   <\/li>\n<li> \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c http proxy:<br \/>   run_proxy_server.cmd<\/li>\n<li> \u0437\u0430\u0434\u0430\u0435\u043c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u043a\u0441\u0438:<br \/>   windows+R, control, ctrl+F, pr<br \/>   \u00ab\u041d\u0430\u0441\u0442\u0440\u043e\u043a\u0430 \u043f\u0440\u043e\u043a\u0441\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u00bb,\u00ab\u041d\u0430\u0441\u0442\u0440\u043e\u043a\u0430 \u0441\u0435\u0442\u0438\u00bb,\u00ab\u041f\u0440\u043e\u043a\u0441\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u00bb,\u00ab\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u043a\u0441\u0438-\u0441\u0435\u0440\u0432\u0435\u0440&#8230;.\u00bb<br \/>   \u0410\u0434\u0440\u0435\u0441: 127.0.0.1 \u041f\u043e\u0440\u0442: 8080<br \/>   \u041e\u043a<\/li>\n<li> \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043a\u043e\u0434 \u043e\u0431\u0435\u0440\u0442\u043a\u0438<\/li>\n<li> \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u044b<\/li>\n<\/ol>\n<p>  \u0414\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u0434\u0432\u0443\u0445 \u043f\u0443\u043d\u043a\u0442\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043b\u044e\u0431\u043e\u0439 \u0438\u0437 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432:  <\/p>\n<ul>\n<li>poweshell \u0438\u0437 \u043a\u043e\u043c\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438<\/li>\n<li>Windows PowerShell<\/li>\n<li>Windows PowerShell ISE<\/li>\n<\/ul>\n<p>  P.S \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 some-radio-server \u0438 some-radio-channel \u043c\u043e\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, icy-e-05.sharp-stream \u0438 kiss100low \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0430 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 other-radio-server \u0438 other-radio-channel \u2014 pub5.di.fm \u0438 di_eurodance.    \t \t\t   \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/175563\/\"> http:\/\/habrahabr.ru\/post\/175563\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">\n<h5>\u0427\u0430\u0441\u0442\u044c \u043f\u0435\u0440\u0432\u0430\u044f: <a href=\"http:\/\/ru.wikipedia.org\/wiki\/Windows_PowerShell\">powershell<\/a> \u0438 <a href=\"http:\/\/ru.wikipedia.org\/wiki\/MCI_(%D0%B8%D0%BD%D1%82%D0%B5%D1%80%D1%84%D0%B5%D0%B9%D1%81)\">mci<\/a>.<\/h5>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u2014 Windows 7.<br \/>  \u041f\u0435\u0440\u0432\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442: \u043a\u0430\u043a \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u0438 mp3 \u0432 powershell?<br \/>  \u0420\u0430\u043d\u0435\u0435 \u043d\u0430 \u0445\u0430\u0431\u0440\u0435 \u0431\u044b\u043b\u0438 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043d\u0438\u044f \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u0432\u043e\u043f\u0440\u043e\u0441\u0430:<br \/>  <a href=\"http:\/\/habrahabr.ru\/qa\/6717\/\">\u041a\u0430\u043a \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u0438 mp3 \u0438\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 Windows 7?<\/a><br \/>  <a href=\"http:\/\/habrahabr.ru\/post\/117441\/\">\u041a\u0430\u043a \u0436\u0435 \u0432\u0441\u0435-\u0442\u0430\u043a\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f PowerShell?<\/a><\/p>\n<p>  \u0412\u0432\u0438\u0434\u0443 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430, \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Media Control Interface \u0438\u043b\u0438 mci.<br \/>  \u041f\u043b\u044e\u0441\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435: \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u0430\u044f \u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u043e\u0441\u0442\u044c, \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0441\u044b\u043b\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432 \u0432\u0438\u0434\u0435 \u0441\u0442\u0440\u043e\u043a\u0438. <br \/>   \u041c\u043d\u043e\u0433\u0438\u043c mci \u0438\u0437\u0432\u0435\u0441\u0442\u0435\u043d \u043f\u043e \u043e\u0442\u0432\u0435\u0442\u0443 \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441: \u00ab\u043a\u0430\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e \u043e\u0442\u0440\u044b\u0442\u044c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u0447\u0442\u0435\u043d\u0438\u044f-\u0437\u0430\u043f\u0438\u0441\u0438 \u043a\u043e\u043c\u043f\u0430\u043a\u0442 \u0434\u0438\u0441\u043a\u043e\u0432?\u00bb, \u0445\u043e\u0442\u044f \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043c\u043d\u043e\u0433\u043e \u0434\u0440\u0443\u0433\u0438\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439. \u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p>  \u0418\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u0435 CD-ROM:  <\/p>\n<pre><code class=\"cs\">mci 'set cdaudio door open' <\/code><\/pre>\n<p>  \u0412\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e mp3-\u0444\u0430\u0439\u043b\u0430:  <\/p>\n<pre><code class=\"cs\">mci 'play C:\\\\temp\\\\Kalimba.mp3' mci 'status C:\\\\temp\\\\Kalimba.mp3 mode' <\/code><\/pre>\n<p>  \u0417\u0430\u043f\u0438\u0441\u044c \u0432 wav-\u0444\u0430\u0439\u043b:  <\/p>\n<pre><code class=\"cs\">mci 'open new type waveaudio alias RecWavFile' mci 'set RecWavFile bitspersample 16 samplespersec 44100 channels 2' mci 'record RecWavFile' mci 'stop RecWavFile' mci 'save RecWavFile C:\\\\temp\\\\RecWavFile.wav' mci 'close RecWavFile' mci 'play C:\\\\temp\\\\RecWavFile.wav wait' <\/code><\/pre>\n<p>  \u041f\u0440\u043e\u0441\u0442\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043f\u043e\u0442\u043e\u043a\u0430 \u0438\u0437 \u0441\u0435\u0442\u0438:  <\/p>\n<pre><code class=\"cs\">mci 'play http:\/\/some-radio-server.com:80\/some-radio-channel.mp3' <\/code><\/pre>\n<p>  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-175563","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/175563","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=175563"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/175563\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=175563"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=175563"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=175563"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}