1. A method of connecting a wireless network of a digital device, the method comprising: receiving a signal from a peer digital device; comparing Receive Signal Strength (RSS) of the received signal with a specified threshold to determine whether the peer digital device is located nearby; and if it is determined that the peer digital device is located nearby, establishing a Wireless Local Area Network (WLAN) connection to the peer digital device, wherein the establishing of the WLAN connection to the peer digital device comprises: obtaining a random number, and generating information necessary for the WLAN connection on the basis of the obtained random number, and wherein the information necessary for the WLAN connection comprises at least one of a service set identifier (SSID), a security key, an Internet Protocol (IP) address, or a personal identification number (PIN).