This commit uses the target type where getRemoteAddress and getLocalAddress are defined. See gh-27120