FYI, Id_IPv4 is defined in the IdGlobal unit:
TIdIPVersion = (Id_IPv4, Id_IPv6);
Indy defaults to IPv4 unless you edit IdCompilerDefines.inc to define IdIPv6 instead of IdIPv4.
As for the code you showed, there are some other problems:
Your OnCommandGet handler is not assigning the AResponseInfo.ResponseNo or AResponseInfo.ContentType properties. And it does not need to call AResponseInfo.WriteContent manually, the content is written when the handler exits.
procedure TForm1.ServerCommandGet(AContext: TIdContext; ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo);
begin
AResponseInfo.ResponseNo := 200;
AResponseInfo.ContentType := 'text/plain';
AResponseInfo.ContentText := 'it works!';
end;
And you are leaking the TIdHTTPServer object, as you do not assign an Owner to it, or Free it in the form's OnDestroy event.
idhttpserver1 := TIdHTTPServer.Create(Self);
Or:
idhttpserver1 := TIdHTTPServer.Create;
...
idhttpserver1.Free;