Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8585327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T22:01:55+00:00 2026-06-11T22:01:55+00:00

I am writing an iOS 5.1.1 app for the iPad2 using Xcode 4.4.1. I

  • 0

I am writing an iOS 5.1.1 app for the iPad2 using Xcode 4.4.1. I want to be able to locate a local http server running on Java.

Once I am able to connect to the http server, all I need to communicate with it is the url including the port.

My questions:

1) Should I use Bonjour or a DNS Server running on the http server to discover the http server itself?

2) I need to authenticate the iPad2 user with name and password to work with the http server once I discover it.

I need some help understanding how I would go about accomplishing these two steps including source code if available for the iOS 5 and Xcode 4.4.1.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T22:01:57+00:00Added an answer on June 11, 2026 at 10:01 pm

    1) Bonjour is pretty easy to tie in with Java apps. If you’re particularly masochistic you can write your own Java-based mDNS (Bonjour) responders (I’ve done it, it’s not rocket science), but the quickest way to get going is to use jMDNS in your http server to advertise its existence. I won’t copy & paste the code samples but they suffice for most applications.

    On the iOS side, NSNetService is your friend. Fundamentally it involves starting a responder in the background to look for services (i.e. your Java app), then calling a delegate when something appears/disappears:

    id delegateObject; // Assume this exists.
    NSNetServiceBrowser *serviceBrowser;
    
    serviceBrowser = [[NSNetServiceBrowser alloc] init];
    [serviceBrowser setDelegate:delegateObject];
    [serviceBrowser searchForServicesOfType:@"_http._tcp" inDomain:@""];
    

    There’s a guide that explains it all. The protocol hasn’t changed for 10+ years and you count on all modern iOS/OS X versions supporting it. The jMDNS library is pretty well battle-tested at this stage, too.

    You might consider creating your own service type if you don’t want it to be visible to other apps that search for _http._tcp., although this is just a cosmetic thing.

    2) The simplest thing that’d work would be HTTP basic auth; you didn’t say what kind of authentication your app supports or how you make HTTP requests on the client side, but this is pretty well covered already.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing an ios app that talks to the asp.net server by using
I'm writing an iOS 5 app (in Xcode 4.3, using Storyboards and ARC) that
I'm writing an iOS app and I need help using the built-in Xcode debugger.
I'm writing an iOS app which can play MIDI and output its content using
I'm writing an iOS app that acts as, among other things, a telnet server.
I'm writing an app in XCode 3.2.3 for iOS 4. In my code, I
In an iOS app I am writing I want to traverse a class hierarchy
I am currently writing an app using XCode that will allow the streaming of
I'm writing the PHP/webserver side of an image upload for an iOS app. Using
In running my program, a basic chat app which i'm writing to learn ios,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.