我正在移动网站上工作,并希望使用我的iPhone浏览器进行测试.我的Windows 7机器和iPhone在同一个无线网络上.如何从iPhone访问localhost?现在我收到404错误.
我正在使用WampServer v2.0在Win 7上开发CodeIgniter应用程序 - 我编辑了我的本地HOSTS文件,以便我可以在这里访问它:ht_tp:// testdomain /而不是ht_tp:// localhost/testdomain/to帮助使其在本地工作时与在实时部署时一样,使用如下行:127.0.0.1 testdomain
当我在同一台PC上访问浏览器中的页面时,此设置工作正常.
现在我正在开发一些移动用途的新页面,例如iPhone,我希望能够直接在iPhone上查看我的网站.手机连接到局域网,我在PC上打开了端口80.
我希望能够在iphone上找到ht_tp:// testdomain /,但它告诉我它无法找到服务器.
//编辑 - 我需要的一个额外部分是我需要能够同时在我的localhost上运行多个站点,并且它们都可以从root运行 - 这就是我想使用testdomain /的原因.
我不确定谷歌目前在做什么,有人可以帮帮我吗?
谢谢,丹
(ht_tp表示http,如果不明显的话)
我正在按照以下教程:http: //mobile.tutsplus.com/tutorials/iphone/building-a-jabber-client-for-ios-server-setup/来设置带有ejabberd服务器的iOS应用程序.到目前为止,我已经将代码复制到一个新项目中.
我的问题是在手机上运行时没有调用XMPP委托函数AppDelegate.m.在Simulator中一切正常,并调用下面的两个函数.
- (void)xmppStreamDidConnect:(XMPPStream *)sender {
NSLog(@"in WSAppDelegate - xmppStreamDidConnect");
isOpen = YES;
NSError *error = nil;
[[self xmppStream] authenticateWithPassword:password error:&error];
}
- (void)xmppStreamDidAuthenticate:(XMPPStream *)sender {
NSLog(@"in WSAppDelegate - xmppStreamDidAuthenticate");
[self goOnline];
}
Run Code Online (Sandbox Code Playgroud)
我可以在手机和模拟器上连接,因为此调用运行时没有错误:
[xmppStream connect:&error]
Run Code Online (Sandbox Code Playgroud)
这是我的AppDelegate.h代码:
#import <UIKit/UIKit.h>
#import "XMPPRoster.h"
#import "XMPP.h"
#import "SMChatDelegate.h"
#import "SMMessageDelegate.h"
@class SMBuddyListViewController;
@interface WSAppDelegate : NSObject <UIApplicationDelegate> {
UIWindow *window;
SMBuddyListViewController *viewController;
XMPPStream *xmppStream;
XMPPRoster *xmppRoster;
NSString *password;
BOOL isOpen;
}
@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, …
Run Code Online (Sandbox Code Playgroud)