@@ -157,6 +157,8 @@ @interface GCDWebServerRequest () {
157157 NSString * _noneMatch;
158158 NSRange _range;
159159 BOOL _gzipAccepted;
160+ NSData * _localAddress;
161+ NSData * _remoteAddress;
160162
161163 BOOL _opened;
162164 NSMutableArray * _decoders;
@@ -168,7 +170,7 @@ @interface GCDWebServerRequest () {
168170@implementation GCDWebServerRequest : NSObject
169171
170172@synthesize method=_method, URL=_url, headers=_headers, path=_path, query=_query, contentType=_type, contentLength=_length, ifModifiedSince=_modifiedSince, ifNoneMatch=_noneMatch,
171- byteRange=_range, acceptsGzipContentEncoding=_gzipAccepted, usesChunkedTransferEncoding=_chunked;
173+ byteRange=_range, acceptsGzipContentEncoding=_gzipAccepted, usesChunkedTransferEncoding=_chunked, localAddressData=_localAddress, remoteAddressData=_remoteAddress ;
172174
173175- (instancetype )initWithMethod : (NSString *)method url : (NSURL *)url headers : (NSDictionary *)headers path : (NSString *)path query : (NSDictionary *)query {
174176 if ((self = [super init ])) {
@@ -308,6 +310,14 @@ - (void)setAttribute:(id)attribute forKey:(NSString*)key {
308310 [_attributes setValue: attribute forKey: key];
309311}
310312
313+ - (NSString *)localAddressString {
314+ return GCDWebServerStringFromSockAddr (_localAddress.bytes , YES );
315+ }
316+
317+ - (NSString *)remoteAddressString {
318+ return GCDWebServerStringFromSockAddr (_remoteAddress.bytes , YES );
319+ }
320+
311321- (NSString *)description {
312322 NSMutableString * description = [NSMutableString stringWithFormat: @" %@ %@ " , _method, _path];
313323 for (NSString * argument in [[_query allKeys ] sortedArrayUsingSelector: @selector (compare: )]) {
0 commit comments