我正在尝试使用 ApprtcDemo 在 iPhone 和浏览器之间使用 webrtc 进行调用
通过 apprtc.appspot.com 一切正常。但是当我在我的服务器上运行该应用程序时,我能够在浏览器之间进行调用并借助这个 post ,我在浏览器和 android 之间进行了调用。
我无法在 iPhone 和浏览器之间进行调用......
代码更改:
在 APPRTCAppClient.m 中:
//NSString *path = [NSString stringWithFormat:@"https:%@", [url resourceSpecifier]];
NSString *path = [NSString stringWithFormat:@"http:%@", [url resourceSpecifier]];
//NSString *url = [NSString stringWithFormat:@"%@/%@", self.baseURL, self.postMessageUrl];
NSString *url = [NSString stringWithFormat:@"http://xxx.xx.x.xx:9090%@", self.postMessageUrl];
//[request addValue:@"https://apprtc.appspot.com" forHTTPHeaderField:@"origin"];
[request addValue:@"http://xxx.xx.x.xx:9090" forHTTPHeaderField:@"origin"];
在 APPRTCViewController.m 中:
//NSString *url = [NSString stringWithFormat:@"apprtc://apprtc.appspot.com/?r=%@", room];
NSString *url = [NSString stringWithFormat:@"apprtc://xxx.xx.x.xx:9090/?r=%@", room];
在 ios_channel.html 中:
//<script type="text/javascript" src="http://apprtc.appspot.com/_ah/channel/jsapi"></script>
<script type="text/javascript" src="http://xxx.xx.x.xx:9090/_ah/channel/jsapi"></script>
当我尝试连接到服务器上的房间(从 iPhone)时,我收到以下日志消息:
INFO 2014-02-11 07:11:53,911 apprtc.py:350] IN CLASS MainPage
INFO 2014-02-11 07:11:53,927 apprtc.py:246] IN CLASS Room: add_user
INFO 2014-02-11 07:11:53,941 apprtc.py:77] create_channel
INFO 2014-02-11 07:11:53,941 apprtc.py:163] Applying media constraints: {'vi
deo': True, 'audio': True}
INFO 2014-02-11 07:11:53,957 apprtc.py:517] User 80844306 added to room 85
INFO 2014-02-11 07:11:53,957 apprtc.py:518] Room 85 has state [80844306-Fals
e]
INFO 2014-02-11 07:11:53,973 module.py:612] default: "GET /?r=85 HTTP/1.1" 2
00 1744
此时应该调用 ConnectPage 来连接到房间,但是没有任何反应......
当我尝试连接到服务器上的房间(从 android)时,我收到以下日志消息:
INFO 2014-02-11 07:11:53,911 apprtc.py:350] IN CLASS MainPage
INFO 2014-02-11 07:11:53,927 apprtc.py:246] IN CLASS Room: add_user
INFO 2014-02-11 07:11:53,941 apprtc.py:77] create_channel
INFO 2014-02-11 07:11:53,941 apprtc.py:163] Applying media constraints: {'vi
deo': True, 'audio': True}
INFO 2014-02-11 07:11:53,957 apprtc.py:517] User 59372716 added to room 51
INFO 2014-02-11 07:11:53,957 apprtc.py:518] Room 51 has state [59372716-Fals
e]
INFO 2014-02-11 07:11:53,973 module.py:612] default: "GET /?r=51 HTTP/1.1" 2
00 1744
INFO 2014-02-11 07:11:55,142 apprtc.py:306] IN CLASS ConnectPage
INFO 2014-02-11 07:11:55,158 apprtc.py:298] User 59372716 connected to room
51
INFO 2014-02-11 07:11:55,158 apprtc.py:299] Room 51 has state [59372716-True
]
INFO 2014-02-11 07:11:55,190 module.py:612] default: "POST /_ah/channel/conn
ected/ HTTP/1.1" 200 -
通话未接通,因为与房间没有实际连接。
我还尝试使用 wireshark 查看客户端到服务器之间发送的内容,同时使用 android 和 iPhone 作为客户端
从 iPhone:
1009 31.978872000 84.94.156.147 xxx.xx.x.xx HTTP 265 GET /?r=9 HTTP/1.1
1022 32.088116000 xxx.xx.x.xx 84.94.156.147 HTTP 235 HTTP/1.1 200 OK (text/html)
1093 32.788407000 84.94.156.147 xxx.xx.x.xx HTTP 343 GET /_ah/channel/jsapi HTTP/1.1
1404 34.191465000 xxx.xx.x.xx 84.94.156.147 HTTP 769 HTTP/1.1 200 OK (text/javascript)
GET /?r=9 HTTP/1.1 :
Hypertext Transfer Protocol
GET /?r=9 HTTP/1.1\r\n
Expert Info (Chat/Sequence): GET /?r=9 HTTP/1.1\r\n
Message: GET /?r=9 HTTP/1.1\r\n
Severity level: Chat
Group: Sequence
Request Method: GET
Request URI: /?r=9
Request Version: HTTP/1.1
Host: xxx.xx.x.xx:9090\r\n
Connection: keep-alive\r\n
Accept-Encoding: gzip, deflate\r\n
User-Agent: AppRTCDemo/1.0 CFNetwork/672.0.8 Darwin/14.0.0\r\n
Accept-Language: he-il\r\n
Accept: */*\r\n
\r\n
Full request URI: http://xxx.xx.x.xx:9090/?r=9
HTTP request 1/1
Response in frame: 1022
HTTP/1.1 200 OK (text/html):
Hypertext Transfer Protocol
HTTP/1.1 200 OK\r\n
Expert Info (Chat/Sequence): HTTP/1.1 200 OK\r\n
Message: HTTP/1.1 200 OK\r\n
Severity level: Chat
Group: Sequence
Request Version: HTTP/1.1
Status Code: 200
Response Phrase: OK
content-type: text/html; charset=utf-8\r\n
cache-control: no-cache\r\n
Content-Length: 1705\r\n
Content length: 1705
Server: Development/2.0\r\n
Date: Thu, 13 Feb 2014 12:55:23 GMT\r\n
\r\n
HTTP response 1/1
Line-based text data: text/html
(here i have the index.html file filled with the content for each of the vars)
GET /_ah/channel/jsapi HTTP/1.1 :
Hypertext Transfer Protocol
GET /_ah/channel/jsapi HTTP/1.1\r\n
Expert Info (Chat/Sequence): GET /_ah/channel/jsapi HTTP/1.1\r\n
Message: GET /_ah/channel/jsapi HTTP/1.1\r\n
Severity level: Chat
Group: Sequence
Request Method: GET
Request URI: /_ah/channel/jsapi
Request Version: HTTP/1.1
Host: xxx.xx.x.xx:9090\r\n
Connection: keep-alive\r\n
Accept-Encoding: gzip, deflate\r\n
User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 7_0_4 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Mobile/11B554a\r\n
Accept-Language: he-il\r\n
Accept: */*\r\n
\r\n
Full request URI: http://xxx.xx.x.xx:9090/_ah/channel/jsapi
HTTP request 1/1
Response in frame: 1404
HTTP/1.1 200 OK (text/javascript):
HTTP/1.1 200 OK (text/html):
Hypertext Transfer Protocol
HTTP/1.1 200 OK\r\n
Expert Info (Chat/Sequence): HTTP/1.1 200 OK\r\n
Message: HTTP/1.1 200 OK\r\n
Severity level: Chat
Group: Sequence
Request Version: HTTP/1.1
Status Code: 200
Response Phrase: OK
cache-control: no-cache\r\n
content-type: text/javascript\r\n
Content-Length: 238051\r\n
Content length: 238051
Server: Development/2.0\r\n
Date: Thu, 13 Feb 2014 12:55:24 GMT\r\n
\r\n
HTTP response 1/1
Line-based text data: text/html
(here i have the jsapi file)
来自安卓:
2103 64.994817000 62.219.128.171 xxx.xx.x.xx HTTP 231 GET /?r=7 HTTP/1.1
2109 65.056073000 xxx.xx.x.xx 62.219.128.171 HTTP 225 HTTP/1.1 200 OK (text/html)
2329 68.436749000 62.219.128.171 xxx.xx.x.xx HTTP 499 GET /_ah/channel/jsapi HTTP/1.1
2659 71.766089000 xxx.xx.x.xx 62.219.128.171 HTTP 869 HTTP/1.1 200 OK (text/javascript)
2723 72.548316000 62.219.128.171 xxx.xx.x.xx HTTP 582 GET /_ah/channel/dev? command=connect&channel=52dc587e2a55f84d5a24d607e01265a6-channel-2672196958-1392299260-7/48366753 HTTP/1.1
2725 72.551059000 xxx.xx.x.xx 62.219.128.171 HTTP 67 HTTP/1.1 200 OK (text/plain)
2755 73.546369000 62.219.128.171 xxx.xx.x.xx HTTP 588 GET /_ah/channel/dev? command=poll&channel=52dc587e2a55f84d5a24d607e01265a6-channel-2672196958-1392299260- 7/48366753&client=1 HTTP/1.1
2756 73.547829000 xxx.xx.x.xx 62.219.128.171 HTTP 191 HTTP/1.1 200 OK
GET /?r=7 HTTP/1.1 :
Hypertext Transfer Protocol
GET /?r=7 HTTP/1.1\r\n
Expert Info (Chat/Sequence): GET /?r=7 HTTP/1.1\r\n
Message: GET /?r=7 HTTP/1.1\r\n
Severity level: Chat
Group: Sequence
Request Method: GET
Request URI: /?r=7
Request Version: HTTP/1.1
User-Agent: Dalvik/1.6.0 (Linux; U; Android 4.3; Nexus 4 Build/JWR66V)\r\n
Host: xxx.xx.x.xx:9090\r\n
Connection: keep-alive\r\n
Accept-Encoding: gzip\r\n
\r\n
Full request URI: http://xxx.xx.x.xx:9090/?r=7
HTTP request 1/1
Response in frame: 2109
HTTP/1.1 200 OK (text/html):
Hypertext Transfer Protocol
HTTP/1.1 200 OK\r\n
Expert Info (Chat/Sequence): HTTP/1.1 200 OK\r\n
Message: HTTP/1.1 200 OK\r\n
Severity level: Chat
Group: Sequence
Request Version: HTTP/1.1
Status Code: 200
Response Phrase: OK
content-type: text/html; charset=utf-8\r\n
cache-control: no-cache\r\n
Content-Length: 1695\r\n
Content length: 1695
Server: Development/2.0\r\n
Date: Thu, 13 Feb 2014 13:17:39 GMT\r\n
\r\n
HTTP response 1/2
Line-based text data: text/html
(here i have the index.html file filled with the content for each of the vars)
GET /_ah/channel/jsapi HTTP/1.1 :
Hypertext Transfer Protocol
GET /_ah/channel/jsapi HTTP/1.1\r\n
Expert Info (Chat/Sequence): GET /_ah/channel/jsapi HTTP/1.1\r\n
Message: GET /_ah/channel/jsapi HTTP/1.1\r\n
Severity level: Chat
Group: Sequence
Request Method: GET
Request URI: /_ah/channel/jsapi
Request Version: HTTP/1.1
Host: xxx.xx.x.xx:9090\r\n
Connection: keep-alive\r\n
Referer: http://xxx.xx.x.xx:9090/\r\n
Accept: */*\r\n
X-Requested-With: org.appspot.apprtc\r\n
User-Agent: Mozilla/5.0 (Linux; U; Android 4.3; he-il; Nexus 4 Build/JWR66V) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30\r\n
Accept-Encoding: gzip, deflate\r\n
Accept-Language: he-IL, en-US\r\n
Accept-Charset: utf-8, iso-8859-1, utf-16, *;q=0.7\r\n
\r\n
Full request URI: http://xxx.xx.x.xx:9090/_ah/channel/jsapi
HTTP request 1/8
HTTP/1.1 200 OK (text/javascript):
HTTP/1.1 200 OK (text/html):
Hypertext Transfer Protocol
HTTP/1.1 200 OK\r\n
Expert Info (Chat/Sequence): HTTP/1.1 200 OK\r\n
Message: HTTP/1.1 200 OK\r\n
Severity level: Chat
Group: Sequence
Request Version: HTTP/1.1
Status Code: 200
Response Phrase: OK
cache-control: no-cache\r\n
content-type: text/javascript\r\n
Content-Length: 238051\r\n
Content length: 238051
Server: Development/2.0\r\n
Date: Thu, 13 Feb 2014 13:17:42 GMT\r\n
\r\n
HTTP response 1/8
Line-based text data: text/html
(here i have the jsapi file)
任何人都可以帮助解决这个问题。 此时任何关于如何进行的想法都会很好。
提前致谢
最佳答案
我在 WebRTC 团队,很可能 iOS 版本的 AppRTCDemo(现在更名为 AppRTCMobile)没有像您解释的那样工作。让我们知道这是否仍然是一个问题。该应用最近已完成大量工作。
关于ios - 本地服务器上的 ApprtcDemo 在浏览器和 Android 之间工作,但在 iOS 上不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21756690/
我正在尝试使用ruby和Savon来使用网络服务。测试服务为http://www.webservicex.net/WS/WSDetails.aspx?WSID=9&CATID=2require'rubygems'require'savon'client=Savon::Client.new"http://www.webservicex.net/stockquote.asmx?WSDL"client.get_quotedo|soap|soap.body={:symbol=>"AAPL"}end返回SOAP异常。检查soap信封,在我看来soap请求没有正确的命名空间。任何人都可以建议我
我在从html页面生成PDF时遇到问题。我正在使用PDFkit。在安装它的过程中,我注意到我需要wkhtmltopdf。所以我也安装了它。我做了PDFkit的文档所说的一切......现在我在尝试加载PDF时遇到了这个错误。这里是错误:commandfailed:"/usr/local/bin/wkhtmltopdf""--margin-right""0.75in""--page-size""Letter""--margin-top""0.75in""--margin-bottom""0.75in""--encoding""UTF-8""--margin-left""0.75in""-
我在我的项目目录中完成了compasscreate.和compassinitrails。几个问题:我已将我的.sass文件放在public/stylesheets中。这是放置它们的正确位置吗?当我运行compasswatch时,它不会自动编译这些.sass文件。我必须手动指定文件:compasswatchpublic/stylesheets/myfile.sass等。如何让它自动运行?文件ie.css、print.css和screen.css已放在stylesheets/compiled。如何在编译后不让它们重新出现的情况下删除它们?我自己编译的.sass文件编译成compiled/t
我想安装一个带有一些身份验证的私有(private)Rubygem服务器。我希望能够使用公共(public)Ubuntu服务器托管内部gem。我读到了http://docs.rubygems.org/read/chapter/18.但是那个没有身份验证-如我所见。然后我读到了https://github.com/cwninja/geminabox.但是当我使用基本身份验证(他们在他们的Wiki中有)时,它会提示从我的服务器获取源。所以。如何制作带有身份验证的私有(private)Rubygem服务器?这是不可能的吗?谢谢。编辑:Geminabox问题。我尝试“捆绑”以安装新的gem..
我正在编写一个包含C扩展的gem。通常当我写一个gem时,我会遵循TDD的过程,我会写一个失败的规范,然后处理代码直到它通过,等等......在“ext/mygem/mygem.c”中我的C扩展和在gemspec的“扩展”中配置的有效extconf.rb,如何运行我的规范并仍然加载我的C扩展?当我更改C代码时,我需要采取哪些步骤来重新编译代码?这可能是个愚蠢的问题,但是从我的gem的开发源代码树中输入“bundleinstall”不会构建任何native扩展。当我手动运行rubyext/mygem/extconf.rb时,我确实得到了一个Makefile(在整个项目的根目录中),然后当
我花了三天的时间用头撞墙,试图弄清楚为什么简单的“rake”不能通过我的规范文件。如果您遇到这种情况:任何文件夹路径中都不要有空格!。严重地。事实上,从现在开始,您命名的任何内容都没有空格。这是我的控制台输出:(在/Users/*****/Desktop/LearningRuby/learn_ruby)$rake/Users/*******/Desktop/LearningRuby/learn_ruby/00_hello/hello_spec.rb:116:in`require':cannotloadsuchfile--hello(LoadError) 最佳
最近,当我启动我的Rails服务器时,我收到了一长串警告。虽然它不影响我的应用程序,但我想知道如何解决这些警告。我的估计是imagemagick以某种方式被调用了两次?当我在警告前后检查我的git日志时。我想知道如何解决这个问题。-bcrypt-ruby(3.1.2)-better_errors(1.0.1)+bcrypt(3.1.7)+bcrypt-ruby(3.1.5)-bcrypt(>=3.1.3)+better_errors(1.1.0)bcrypt和imagemagick有关系吗?/Users/rbchris/.rbenv/versions/2.0.0-p247/lib/ru
关闭。这个问题需要detailsorclarity.它目前不接受答案。想改进这个问题吗?通过editingthispost添加细节并澄清问题.关闭8年前。Improvethisquestion在首页我有:汽车:VolvoSaabMercedesAudistatic_pages_spec.rb中的测试代码:it"shouldhavetherightselect"dovisithome_pathit{shouldhave_select('cars',:options=>['volvo','saab','mercedes','audi'])}end响应是rspec./spec/request
在Rails4.0.2中,我使用s3_direct_upload和aws-sdkgems直接为s3存储桶上传文件。在开发环境中它工作正常,但在生产环境中它会抛出如下错误,ActionView::Template::Error(noimplicitconversionofnilintoString)在View中,create_cv_url,:id=>"s3_uploader",:key=>"cv_uploads/{unique_id}/${filename}",:key_starts_with=>"cv_uploads/",:callback_param=>"cv[direct_uplo
这里有一个很好的答案解释了如何在Ruby中下载文件而不将其加载到内存中:https://stackoverflow.com/a/29743394/4852737require'open-uri'download=open('http://example.com/image.png')IO.copy_stream(download,'~/image.png')我如何验证下载文件的IO.copy_stream调用是否真的成功——这意味着下载的文件与我打算下载的文件完全相同,而不是下载一半的损坏文件?documentation说IO.copy_stream返回它复制的字节数,但是当我还没有下