an optical connector comprises an insulative housing defining an upper mating port , an optical device received in the housing and having at least one lens exposed to the upper mating port , and a dustproof mechanism movably retained in the housing along a mating direction of the optical connector . the dustproof mechanism includes a dustproof cover disposed in the mating port in an initial position and covering the lens , and a planar base disposed above the mating port and having a pushing projection protruding to an exterior of the optical connector . when the optical connector mates with a corresponding connector , the pushing projection is pushed to bring the dustproof cover leave from the upper mating port for allowing the lens to be exposed to exterior for mating with the corresponding connector .