1. Send a legacy SDP offer to Chrome, in which session version=0, no ice-option. This is correctly processed if feed it to setRemoteDescription, the produced SDP answer has session version=0, no ice-option.
2. Apply the SDP answer in setLocalDescription, return error when trying to match the ice protocol in offer an answer. Offer is recognized as using the google ice protocol, answer is recognized as using RFC5245.
Referred to the Chromium code and seems the problem is this: Transport description is created to use rfc5245 compliant ice by default, only when the backward compatibility procedure is applied would it be changed to use google-ice. However, the backward compatibility procedure is not invoked for setLocalDescription.
Found a workaround later:
1. Construct the SDP offer to use session version=2, add ice-option:google-ice
2. Modify the SDP answer before setLocalDescroption, add ice-option:google-ice
This sets both offer and answer to hybrid mode, in which case Chrome picks google-ice by default, thus my google-ice-only-proxy is able to talk to the browser.
Don't know if this is a bug and will be fixed in v24?