So I'm using cocoahttpserver in my iphone application. I have the webserver working. But for now I need to identify my ip address and port number before an outside browser can access anything I create.
我在iphone应用程序中使用了cocoahttpserver。我让webserver工作。但是现在我需要在外部浏览器访问我创建的任何东西之前识别我的ip地址和端口号。
I would like to have my users connect via a human readable domain name. Even a domain name w/ the port appended would be acceptable.
我希望我的用户通过可读的域名连接。即使是附加的域名w/端口也可以接受。
I'm given to understand Bonjour allows for some degree of domain name resolution via mDNS. Is it even possible to use Bonjour to come to some solution here? I've been trying for some time, but I am running into a myriad of problems. Am I spinning my wheels? It does seem strange that temporary domain name resolution is possible. Any documentation, tutorials, or advice would be greatly appreciated. Thank you.
我知道Bonjour允许通过mDNS进行一定程度的域名解析。甚至可以用Bonjour来解决这个问题吗?我已经尝试了一段时间,但是我遇到了很多问题。我在旋转我的*吗?暂时的域名解析是可能的,这看起来确实很奇怪。任何文档、教程或建议都将非常感谢。谢谢你!
EDIT: Editing to be more clear, I apologize. I only require LOCALIZED domain name resolution. Doing it on a global scale would be folly for obvious reasons. But my app's need will not extend beyond a single wireless router.
编辑:编辑更清楚,我道歉。我只需要本地化域名解析。在全球范围内这么做显然是愚蠢的。但我的应用程序的需求不会超出一个无线路由器。
EDIT: Unfortunately my question has not yet been answered. Here is another reference. Perhaps I didn't make my question clear enough originally. If anyone has advice on best practices to clean up a question, please let me know via comment.
编辑:不幸的是,我的问题还没有得到回答。这是另一个参考。也许我本来就没有把问题说清楚。如果有人对解决问题的最佳实践有什么建议,请通过评论告诉我。
EDIT: This question does not seem to be of value. My true problem seems to lie in the cocoahttpserver implementation of Bonjour and mdns. It seems this problem can be solved, but it is fairly difficult and advanced, which made it hard for me to phrase the question. When I get the rep, I'll recommend this question for removal. Thank you to all who tried to help.
编辑:这个问题似乎没有价值。我真正的问题似乎在于Bonjour和mdns的cocoahttpserver实现。这个问题似乎可以解决,但它是相当困难和先进的,这使我很难提出这个问题。当我得到代表,我将建议这个问题删除。谢谢所有想帮助你的人。
3 个解决方案
#1
1
It sounds like you're looking for a dynamic DNS client for iPhone. A couple quick Google searches turned up these:
这听起来像是你在为iPhone寻找一个动态的DNS客户端。谷歌快速搜索了以下内容:
iDynDNS: http://code.google.com/p/idyndns/
iDynDNS:http://code.google.com/p/idyndns/
EasyDNS: http://gavcode.wordpress.com/2010/05/13/automatic-easydns-on-iphone/
EasyDNS:http://gavcode.wordpress.com/2010/05/13/automatic-easydns-on-iphone/
List of dynamic DNS providers: http://dnslookup.me/dynamic-dns/
动态DNS提供者列表:http://dnslookup.me/dynamicdns/
#2
1
Technically, you can; and here is a related video.
从技术上讲,你可以;这是一个相关的视频。
The idea is that hosting a domain would need a static IP address. A static IP addresses needs to be assigned by your ISP, or a dynamic ISP provider.
这个想法是托管一个域需要一个静态的IP地址。静态IP地址需要由您的ISP或动态ISP分配。
As long as you can bind one particular IP address to your iPhone, every kind of application/web hosting can be done.
只要你能将一个特定的IP地址绑定到你的iPhone上,就可以完成各种各样的应用/网络托管。
Note, your iPhone will have to stick in once place to keep the same IP address.. If you move around between different WiFi spots for example, your IP address will constantly change making the hosted website or service unreachable.
注意,你的iPhone必须保持相同的IP地址。例如,如果你在不同的WiFi点之间移动,你的IP地址将不断变化,使托管的网站或服务无法访问。
Advise: Forget about it :)
建议:忘掉它
#3
0
If it's feasible, you could set up your own domain server, put the iPhone's IP address in that, and have the local machines refer to that DNS server first. Of course, I suspect you don't have an local servers of any description -- that's why you'd be using your iPhone, of all things, as a server; if so, you'd have to fall back on one of the dynamic DNS solutions alberge mentioned or just hand-edit the /etc/hosts file on every local machine.
如果可行,您可以设置自己的域服务器,将iPhone的IP地址放在其中,并让本地机器首先引用该DNS服务器。当然,我怀疑你没有任何描述的本地服务器——这就是为什么你要用你的iPhone作为服务器;如果是这样,您将不得不求助于alberge提到的动态DNS解决方案,或者手工编辑每个本地机器上的/etc/hosts文件。
#1
1
It sounds like you're looking for a dynamic DNS client for iPhone. A couple quick Google searches turned up these:
这听起来像是你在为iPhone寻找一个动态的DNS客户端。谷歌快速搜索了以下内容:
iDynDNS: http://code.google.com/p/idyndns/
iDynDNS:http://code.google.com/p/idyndns/
EasyDNS: http://gavcode.wordpress.com/2010/05/13/automatic-easydns-on-iphone/
EasyDNS:http://gavcode.wordpress.com/2010/05/13/automatic-easydns-on-iphone/
List of dynamic DNS providers: http://dnslookup.me/dynamic-dns/
动态DNS提供者列表:http://dnslookup.me/dynamicdns/
#2
1
Technically, you can; and here is a related video.
从技术上讲,你可以;这是一个相关的视频。
The idea is that hosting a domain would need a static IP address. A static IP addresses needs to be assigned by your ISP, or a dynamic ISP provider.
这个想法是托管一个域需要一个静态的IP地址。静态IP地址需要由您的ISP或动态ISP分配。
As long as you can bind one particular IP address to your iPhone, every kind of application/web hosting can be done.
只要你能将一个特定的IP地址绑定到你的iPhone上,就可以完成各种各样的应用/网络托管。
Note, your iPhone will have to stick in once place to keep the same IP address.. If you move around between different WiFi spots for example, your IP address will constantly change making the hosted website or service unreachable.
注意,你的iPhone必须保持相同的IP地址。例如,如果你在不同的WiFi点之间移动,你的IP地址将不断变化,使托管的网站或服务无法访问。
Advise: Forget about it :)
建议:忘掉它
#3
0
If it's feasible, you could set up your own domain server, put the iPhone's IP address in that, and have the local machines refer to that DNS server first. Of course, I suspect you don't have an local servers of any description -- that's why you'd be using your iPhone, of all things, as a server; if so, you'd have to fall back on one of the dynamic DNS solutions alberge mentioned or just hand-edit the /etc/hosts file on every local machine.
如果可行,您可以设置自己的域服务器,将iPhone的IP地址放在其中,并让本地机器首先引用该DNS服务器。当然,我怀疑你没有任何描述的本地服务器——这就是为什么你要用你的iPhone作为服务器;如果是这样,您将不得不求助于alberge提到的动态DNS解决方案,或者手工编辑每个本地机器上的/etc/hosts文件。