(해석 또는 이해가 잘못된 부분이 있다면 댓글로 편하게 알려주세요.)
URLs provide a means of locating any resource on the Internet, but these resources can be accessed by different schemes (e.g., HTTP, FTP, SMTP), and URL syntax varies from scheme to scheme.
URL은 인터넷상의 모든 리소스 위치를 나타내는 수단을 제공한다.
그러나 이러한 리소스들은 서로 다른 scheme(HTTP, FTP, SMTP)을 통해 접근될 수 있다. 그리고 URL 구문은 scheme마다 다르다.
Does this mean that each different URL scheme has a radically different syntax? In practice, no. Most URLs adhere to a general URL syntax, and there is significant overlap in the style and syntax between different URL schemes.
이것이 과연 서로 다른 URL Scheme이 완전히 다른 구문을 가지고 있음을 의미할까요? 그렇지는 않습니다.
대부분의 URL은 보편화된 URL 구문을 차용하고, 서로 다른 URL scheme간의 스타일과 구문이 종종 중첩되어 나타납니다.
Most URL schemes base their URL syntax on this nine-part general format:
<scheme>://<user>:<password>@<host>:<port>/<path>;<params>?<query>#<frag>
Almost no URLs contain all these components. The three most important parts of a URL are the scheme, the host, and the path. Table 2-1 summarizes the various components.
For example, consider the URL http://www.joes-hardware.com:80/index.html. The scheme is “http”, the host is “www.joes-hardware.com”, the port is “80”, and the path is “/index.html”.
예를 들어, "http://www.joes-hardware.com:80/index.html"이라는 URL이 있다고 가정합니다.
이때 Scheme은 "http", Host는 "www.joes-hardware.com", Port는 "80", Path는 "/index.html"입니다.
The scheme is really the main identifier of how to access a given resource; it tells the application interpreting the URL what protocol it needs to speak. In our simple HTTP URL, the scheme is simply “http”.
Scheme은 주어진 리소스의 접근 방식에 대한 주요 식별자입니다. URL을 해석하는 애플리케이션이 어떤 프로토콜을 사용해야 하는지를 알려줍니다.
우리의 예제 HTTP URL에서, Scheme은 간단히 "http"입니다.
The scheme component must start with an alphabetic character, and it is separated from the rest of the URL by the first “:” character. Scheme names are case- insensitive, so the URLs “http://www.joes-hardware.com” and “HTTP://www.joes- hardware.com” are equivalent.
Scheme 구성 요소는 반드시 알파벳 문자로 시작해야 하고, 첫 번째 ":" 문자로 URL의 나머지 부분과 구별됩니다.
Scheme의 이름은 대소문자 구분이 없어 "http://www.joes-hardware.com"과 "HTTP://www.joes-hardware.com"을 동일하게 취급합니다.
To find a resource on the Internet, an application needs to know what machine is hosting the resource and where on that machine it can find the server that has access to the desired resource. The host and port components of the URL provide these two pieces of information.
인터넷에서 리소스를 찾기 위해서, 애플리케이션은 어떤 장치가 리소스를 향유하고 있고 장치의 어느 곳에서 요청받은 리소스에 접근할 서버를 찾을 수 있는지 알아야 합니다.
URL의 호스트와 포트 구성 요소는 이 두 가지의 정보를 제공합니다.
The host component identifies the host machine on the Internet that has access to the resource. The name can be provided as a hostname, as above (“www.joes-hardware. com”) or as an IP address. For example, the following two URLs point to the same resource—the first refers to the server by its hostname and the second by its IP address:
http://www.joes-hardware.com:80/index.html http://161.58.228.45:80/index.html
호스트는 인터넷상에서 리소스에 접근할 호스트 장치를 식별합니다. 그 이름은 위의 예제에서와 같이("www.joes-hardware.com") 호스트명이나 IP 주소로 제공됩니다.
예를 들어, 아래의 두 가지 URL은 같은 리소스를 가리키고 있습니다. 첫 번째 방식은 서버를 호스트명으로 나타내고 두 번째 방식은 서버를 IP 주소로 나타내고 있습니다.
The port component identifies the network port on which the server is listening. For HTTP, which uses the underlying TCP protocol, the default port is 80.
포트는 연결을 기다리고 있는 서버의 네트워크 포트를 식별합니다.
TCP 프로토콜에 기초하는 HTTP의 경우 디폴트 포트 번호가 80입니다.
More interesting components are the user and password components. Many servers require a username and password before you can access data through them. FTP servers are a common example of this. Here are a few examples:
ftp://ftp.prep.ai.mit.edu/pub/gnu ftp://anonymous@ftp.prep.ai.mit.edu/pub/gnu ftp://anonymous:my_passwd@ftp.prep.ai.mit.edu/pub/gnu http://joe:joespasswd@www.joes-hardware.com/sales_info.txt
보다 흥미로운 구성 요소는 사용자와 패스워드입니다.
많은 서버가 데이터를 접근할 수 있게 하기 전에 사용자와 패스워드를 요구합니다.
FTP 서버가 이것의 일반적인 예시입니다. 여기 몇 가지 예시가 더 있습니다.
The first example has no user or password component, just our standard scheme, host, and path. If an application is using a URL scheme that requires a username and password, such as FTP, it generally will insert a default username and password if they aren’t supplied. For example, if you hand your browser an FTP URL without specifying a username and password, it will insert “anonymous” for your username and send a default password (Internet Explorer sends “IEUser”, while Netscape Navigator sends “mozilla”).
첫 번째 예시는 사용자나 패스워드를 가지고 있지 않고, 표준 Scheme과 호스트, 경로만을 가지고 있습니다.
만약 애플리케이션이 FTP처럼 사용자의 이름과 패스워드를 요구하는 URL Scheme을 사용하고 있다면, 이를 입력받지 못한 경우 일반적으로 디폴트 사용자 이름과 패스워드를 삽입할 것입니다.
예를 들어, 사용자 이름과 패스워드를 명시하지 않은 채로 브라우저에게 FTP URL을 전달하면 사용자 이름으로 "anonymous"를 삽입하고 디폴트 패스워드(Internet Explorer은 "IEUser", Netscape Navigator는 "mozilla")를 전달합니다.
The second example shows a username being specified as “anonymous”. This username, combined with the host component, looks just like an email address. The “@” character separates the user and password components from the rest of the URL.
두 번째 예시는 "anonymous"로 특정된 사용자 이름을 표시합니다.
호스트 구성요소와 결합된 사용자 이름은 마치 이메일 주소처럼 보입니다. "@" 문자가 사용자와 패스워드를 URL의 나머지 부분과 구분합니다.
In the third example, both a username (“anonymous”) and password (“my_passwd”) are specified, separated by the “:” character.
세 번째 예시는 사용자 이름 "anonymous"와 패스워드 "my_passwd"로 특정되어 있습니다.
사용자 이름과 패스워드는 ":" 문자로 구분됩니다.
<scheme>://<user>:<password>@<host>:<port>/<path>;<params>?<query>#<frag>
단순해보이는 URL 문장 하나에 수많은 함축적 의미가 담겨 있음을 배웠다. URL의 구문을 잘 기억해두고 필요할 때 URL의 구성 요소를 잘 선별하여 사용하면 좋을 것 같다.
다음 포스팅에서 다룰 Path, Params, Query, Frag도 상당히 중요한 개념이니 계속해서 힘을 내봐야겠다!