Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Reach local iTunes library over the net Internet
If you want to reach your iTunes library from a remote Mac (a MacBook while traveling, for instance), you can enter these two lines in your Terminal app :
$ dns-sd -P "any name" _daap._tcp. local 3690 localhost 127.0.0.1 & 
$ ssh -N user@server.example.com -L 3690:localhost:3689
Replace user with your short username on the remote Mac, and server.example.com with the public IP of the remote Mac. Don't forget to set up your remote router so that the ssh port (22) is forwarded to a Mac on which the SSH daemon is launched (Remote Login enabled on the Sharing System Preferences panel).

You can put this in a shell script (thanks to andersB):
#!/bin/bash 
dns-sd -P "name of server" _daap._tcp local 3690 localhost 127.0.0.1 & 
PID=$! 
ssh -N user@server.example.com -L 3690:localhost:3689
kill $PID
This will start the broadcaster, set up the tunnel, and kill the broadcaster once the tunnel closes. I use port 3690 on the local machine, as to not interfere with the iTunes sharing on that host. This enables me to both see the remote share and share something from my local iTunes with the users on the network your laptop is in. It could be perfect if someone could find a way to double-click this script to run it.

[robg adds: You should be able to run this from the Finder by just double-clicking the shell script file; on my 10.5 machine, at least, that opens Terminal and runs the script. Alternatively, you could paste the script into an Automator action and save the result as an application. Note that I haven't tested this hint.]
    •    
  • Currently 2.00 / 5
  You rated: 2 / 5 (9 votes cast)
 
[19,546 views]  

Reach local iTunes library over the net | 20 comments | Create New Account
Click here to return to the 'Reach local iTunes library over the net' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Reach local iTunes library over the net
Authored by: ctierney on Apr 22, '08 09:04:58AM
The following script saved as an application should do the trick:
http://putnamhill.net/applescript/editor/remoteitunes/

[ Reply to This | # ]
Reach local iTunes library over the net
Authored by: bcometa on Apr 22, '08 09:52:03AM
Or skip all the command line stuff and download one of the many freeware GUI applications that do the same and more with little to no setup time.

Lately I've been using SimplifyMedia, which works on Macs, PCs, and iPhone! Another free and open source option is Mojo, which also works on Mac & PC.

corewerkz

[ Reply to This | # ]

Reach local iTunes library over the net
Authored by: rossr on Apr 22, '08 10:30:48AM

Just as a head's up, Mojo is technically not open source and it's "kinda" free. You can use a free version with basic features (file sharing, etc.), but there is also a paid version with more features (subscriptions, support, etc.). It's pretty darn cheap and well worth it (in my humble opinion).



[ Reply to This | # ]
Reach local iTunes library over the net
Authored by: justspaztik on Apr 22, '08 11:01:49AM

I don't know what I am doing wrong... this isn't working for me. I have the correct ports open and I have iTunes set to share my library but, it still gives me an error when I try to access it in iTunes on the Remote computer. Can anyone help me?



[ Reply to This | # ]
Reach local iTunes library over the net
Authored by: Alrescha on Apr 22, '08 05:59:49PM

"Can anyone help me?"

Try changing 'localhost' in the ssh command to '127.0.0.1'

A.



[ Reply to This | # ]
Reach local iTunes library over the net
Authored by: Boufon on Apr 24, '08 02:06:22PM
Use this command instead of the original one I suggested initially :
dns-sd -P "name of server" _daap._tcp local 3690 localhost.local 127.0.0.1 & 
it should be much better

[ Reply to This | # ]
Reach local iTunes library over the net
Authored by: janaukes on Apr 22, '08 10:21:37PM

I still use AccessTunes. It is a small server. By using you ip-address wth the right port number in your browser you can reach that server and listen to your music. You also can download the music as playlist for using it within iTunes.



[ Reply to This | # ]
Reach local iTunes library over the net
Authored by: jaknudsen on Apr 23, '08 01:50:14AM

I'm using MyTunesRSS to play my music in any browser. It also has last.fm support.



[ Reply to This | # ]
Reach local iTunes library over the net
Authored by: Boufon on Apr 24, '08 02:03:20PM

When I posted this hint, I made a small mistake. So this hint could not work if your remote iTunes is connected on Internet with the same ISP.

To fix that you've to replace the first 'dns-sd' command with the following one :
dns-sd -P "name of server" _daap._tcp local 3690 localhost.local 127.0.0.1 &

To create a double-clicable shell script add the ".command" extension instead of ".sh" and the script can be double-clcked.

"Simplify media" is interesting but it uses a third party server. With this hint no third party server is required.

I think that the "Network Beacon" application is using exactly the same dns-sd command.

One strange thing I've noticed. If you enter 'man dns-sd' many options ar not described. To discover the other options, you have to enter dns-sd without any argument.








[ Reply to This | # ]
Reach local iTunes library over the net
Authored by: topherchris9 on Apr 24, '08 07:09:35PM

How well do you think this would work for videos in my iTunes? I recently began importing DVD's in and would like to watch the stuff I've bought in iTunes from a remote location. I assume it would require a really fast connection, however I'm wondering if my speedy connection here at the office would be enough.



[ Reply to This | # ]
Reach local iTunes library over the net
Authored by: Boufon on Apr 24, '08 11:09:20PM

It will works. These 2 commands will also publish your movies available in your remote iTunes. My upload DSL connection is a 800 kb/sec and it works for my mp4 movies. But I think it will depend on the codec used to compress your movies.



[ Reply to This | # ]
Reach local iTunes library over the net
Authored by: Skipper2000 on Jul 10, '08 10:34:08PM
Odd, everything sets up nice even with using the update ssh command line. The share shows up in iTunes but I get
"The shared library [MyLibraryName] is not responding. (-39) Check that any firewall software running on either the shared computer or this computer has been set to allow communication on port 3690"
I understood it like the 3690 port is locally forwarded to the 3690 port on the remote machine through the SSH-tunnel so there was no need to open any firewalls?

[ Reply to This | # ]
Reach local iTunes library over the net
Authored by: faze on Mar 16, '09 08:10:27AM

This seems to have been broken with the itunes 8.1 update. I ran ssh with the verbosity turned all the way up and it's being cut off before anything is forwarded over ssh.

The mdns name I set up is showing in itunes, but is gone 1 second after I click it.

Can anyone else that did the 8.1 update confirm that this is broken?



[ Reply to This | # ]
Reach local iTunes library over the net
Authored by: Boufon on Mar 17, '09 12:40:16AM

This trick doesn't work anymore since iTunes 8.1 !
Any idea ?



[ Reply to This | # ]
Reach local iTunes library over the net
Authored by: bmishkin on Apr 17, '09 11:39:22AM

Confirmed, no longer works w/ itunes 8.1.1 .

If I find a fix, will post.



[ Reply to This | # ]
Reach local iTunes library over the net
Authored by: roach on May 08, '09 11:17:54PM
Instead of
dns-sd -P "name of server" _daap._tcp local 3690 localhost 127.0.0.1
I used
dns-sd -R "name of server" _daap._tcp. local 3690 localhost 127.0.0.1
Seems to work great. If I get excited I'll post a launchd script. :)

[ Reply to This | # ]
Reach local iTunes library over the net
Authored by: cyberkni on May 13, '09 07:12:43AM
This works!
One catch with it though:
I needed to allow remote hosts to connect to my ssh port forwards via the -g option(or GatewayPorts yes in ~/ssh/.config for that host)
ssh -gNf -L 3690:localhost:3689 remote-machine-with-itunes
dns-sd -R "remote itunes" _daap._tcp. local 3690 localhost 127.0.0.1 &



[ Reply to This | # ]
Reach local iTunes library over the net
Authored by: cyberkni on May 13, '09 07:17:27AM
I have a plist to run my dns-sd registration in the background. I created a ~/Library/LaunchAgents/com.apple.dnssd.plist file which looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">;
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.apple.dnssdproxy</string>
<key>OnDemand</key>
<false/>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/dns-sd</string>
<string>-R</string>
<string>Home iTunes</string>
<string>_daap._tcp.</string>
<string>local</string>
<string>3690</string>
<string>localhost</string>
<string>127.0.0.1</string>
</array>
</dict>
</plist>

Load it up with launchctl load ~/Library/LaunchAgents/com.apple.dnssd.plist

[ Reply to This | # ]
Reach local iTunes library over the net
Authored by: incanus on May 26, '09 09:49:02PM

I too saw this problem with Meerkat and iTunes 8.1, but I discovered a fix for it. I'm not sure how it translates to the dns-sd tool, but this is the Cocoa code that I use:

NSDictionary *txt = [NSDictionary dictionaryWithObjectsAndKeys:
    [@"1" dataUsingEncoding:NSUTF8StringEncoding], @"txtvers",
    [@"131073" dataUsingEncoding:NSUTF8StringEncoding], @"iTSh Version",
    [@"196610" dataUsingEncoding:NSUTF8StringEncoding], @"Version",
    nil];

NSData *txtData = [NSNetService dataFromTXTRecordDictionary:txt];

[bonjourServer setTXTRecordData:txtData];

It adds some protocol-specific options that have always been there, but that iTunes just started requiring. The above equate to an advertised iTunes version 6.0.4, which is the oldest one I could see in use on most networks.



[ Reply to This | # ]
Reach local iTunes library over the net
Authored by: bmishkin on Sep 01, '09 05:29:46AM
Mobileme DNS no longer works. If you know the remote machine IP, this script is working for me. Fill in your REMOTE_ITUNES_IP.
#!/bin/bash 

ssh -gNf -L 3690:localhost:3689 REMOTE_ITUNES_IP
dns-sd -R "remote_itunes" _daap._tcp. local 3690 localhost 127.0.0.1 &


[ Reply to This | # ]